-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
private macros break intra-doc links #81633
Comments
Assigning |
After a deeper look, this seems like a low priority considering how rare it is. I'll still continue to check what's going on. |
I can't investigate this currently due to #87783 🤦 |
I continue to be stymied in investigating this 🤦 #91400 |
Ok, I managed to mostly reproduce this without using types from the standard library - my code has different bugs but there are still bugs. pub mod foo {
pub struct Bar(Baz);
impl std::ops::Deref for Bar {
type Target = Baz;
fn deref(&self) -> &Baz { &self.0 }
}
pub struct Baz {}
impl Baz {
/// [str]
pub fn foo(&self) {
str!()
}
}
}
mod bar {
macro_rules! str {() => {}}
} That has the following output when run with rustdoc:
and with rustc:
|
Oh, and Deref isn't related, you get the same issues without it: mod bar {
macro_rules! str {() => {}}
}
pub mod foo {
pub struct Baz {}
impl Baz {
/// [str]
pub fn foo(&self) {
// str!()
}
}
} |
This is the code that's incorrectly resolving rust/src/librustdoc/passes/collect_intra_doc_links.rs Lines 413 to 415 in f04a2f4
That was first added in #47046, specifically 00ce770. There are two other macro lookups in that function, @Manishearth do you think we need all three of these? I'm tempted to remove everything but |
Tried this and I'm not seeing any test failures :) |
|
…illaumeGomez rustdoc: Resolve doc links referring to `macro_rules` items cc rust-lang#81633 UPD: the fallback to considering *all* `macro_rules` in the crate for unresolved names is not removed in this PR, it will be removed separately and will be run through crater.
This was fixed (with a test) in #96676, closing. |
rustdoc: Resolve doc links referring to `macro_rules` items cc rust-lang/rust#81633 UPD: the fallback to considering *all* `macro_rules` in the crate for unresolved names is not removed in this PR, it will be removed separately and will be run through crater.
In the documentation of
Foo::to_str()
inherited from the deref impl, the documentation contains a link to[`&str`](str)
that fails due to the presence of astr!
macro in another module, even though that macro isn't accessible. (Even if it was, it shouldn't be affecting the resolution of an intra-doc link in the standard library.)Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: