-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: broken_intra_doc_links
triggers on link to private item
#83049
Comments
Does it work without |
Well, if you look at the label in the error message, the issue is not in finding Also, using
Weirdly, it says |
rust/src/librustdoc/passes/collect_intra_doc_links.rs Lines 1038 to 1054 in acca818
|
I think the error is actually correct - |
I thought you're allowed to link to any private item from anywhere else...? I minimized this code from a project I'm working on, so there are definitely use cases. |
I don't think there's ever been docs on what private items you can link to. Notice that this is the "broken" lint and not the "private" lint - rustc_resolve itself is giving this error, not rustdoc, and it would need massive changes to be different (which I doubt @petrochenkov would be happy about). |
It looks like mod foo {
fn error() {
super::bar::baz()
}
}
mod bar {
fn baz() {}
}
I'm not 100% certain, but I think that error might be coming from here: rust/compiler/rustc_resolve/src/lib.rs Line 2923 in 42816d6
rust/compiler/rustc_resolve/src/diagnostics.rs Lines 1129 to 1133 in 42816d6
rust/compiler/rustc_resolve/src/imports.rs Lines 324 to 330 in 42816d6
Is there some way we can pick up on the fact that the item exists, but is private? Otherwise it's really confusing because the item does exist — so I end up trying to look for typos in the path, when in reality it's just that the item is private. |
For the reason the parse module is made pub(crate), see github:rust-lang/rust/issues/83049
For the reason the parse module is made pub(crate), see github:rust-lang/rust/issues/83049
Simplified: //! [`priv_mod::priv_fn`]
mod priv_mod { fn priv_fn() {} } |
The fact this happens even when using |
I'm looking into fixing this, can't promise anything though |
Discussion needs to take place and agreement needs to be reached before implementing this! See #83049 (comment).
This should succeed, but it does not.
The text was updated successfully, but these errors were encountered: