-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
intra-doc links: crate
means something different when an item is re-exported
#77193
Comments
All of this was wrong, I forgot to use +nightlyThis isn't related to scopes, rustdoc will also fail to resolve these links: /// [crate::process::Command]
///
/// [Vec]
pub use std::string::String; Something about the re-export itself is messing it up. |
The good news is this is unrelated to proc-macros. Here's what I found: /// [std::process::Command] // works
///
/// [Vec] // works
/// [with_code] // silently breaks
/// [crate::with_code] // works
pub use std::string::String; This is really strange. I would have expected it to resolve relative to |
Ok, I found the issue: rustdoc and resolve disagree about which crate this is in 🤦
For This explains a lot of other broken links I've been seeing actually: anything that has The fix will be a little tricky ... there's no 'change
A possible way to implement 2. is by stripping |
crate
means something different when an item is re-exported
Marking as P-high after discussing with @GuillaumeGomez ; it would be unfortunate to still have this bug on the first release after stabilization. |
Resolve `crate` in intra-doc links properly across crates Closes rust-lang#77193; see rust-lang#77193 (comment) for an explanation of what's going on here. ~~This also fixes the BTreeMap docs that have been broken for a while; see the description on the second commit for why and how.~~ Nope, see the second commit for why the link had to be changed. r? @Manishearth cc @dylni @dylni note that this doesn't solve your original problem - now _both_ `with_code` and `crate::with_code` will be broken links. However this will fix a lot of other broken links (in particular I think https://docs.rs/sqlx/0.4.0-beta.1/sqlx/query/struct.Query.html is because of this bug). I'll open another issue for resolving additional docs in the new scope.
Crate quit exports
main
from quit_macros.main
is documented in quit and has no documentation in quit_macros.When that documentation has a link to
[with_code]
, which is only in crate quit, it is unresolved. However,[crate::with_code]
is resolved.Rustdoc gives no warnings with either.
You can see the result with quit version 1.1.1 here.
cc @jyn514
cc #76106 (comment)
The text was updated successfully, but these errors were encountered: