-
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
Index cross-mod type definition and implementation properly in rustdoc #12752
Conversation
The ugly |
let path = match self.paths.find(last) { | ||
Some(&(_, "trait")) => | ||
Some(self.stack.slice_to(self.stack.len() - 1)), | ||
Some(&(ref fqp, "struct")) => Some(fqp.slice_to(fqp.len() - 1)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here about what this is doing? Just something indicating that our stack has no correlation for where the type was defined.
I think this also needs to handle enums.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why enum
? There's no definition implementation split problem for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean its variants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I has the same problem as structs:
mod b {
impl ::a::Test {
fn foo(&self) {}
}
}
mod a {
pub enum Test { Test1 }
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One can impl an enum
? I wasn't aware of that :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
A structure's definition and implementation may be cross-module. If the implementing module is parsed before defining module, the fully qualified name of the structure won't be present for the implementation to use when being indexed. So caches such 'orphan' implementation and indexes it at the end of crate parsing. Closes rust-lang#10284.
All comments addressed. |
A structure's definition and implementation may be cross-module. If the implementing module is parsed before defining module, the fully qualified name of the structure won't be present for the implementation to use when being indexed. So caches such 'orphan' implementation and indexes it at the end of crate parsing. Closes #10284.
…e_for_test, r=blyxyas Disable assigning_clones for tests Close: rust-lang#12752 As mentioned at rust-lang#12752 when a test struct is initialized with some default string, this inverts the order of assignee/assignment and makes a bit harder to read/write code changelog: [`assigning_clones.rs`]: disable assigning_clones for tests
A structure's definition and implementation may be cross-module. If the
implementing module is parsed before defining module, the fully
qualified name of the structure won't be present for the implementation
to use when being indexed. So caches such 'orphan' implementation and
indexes it at the end of crate parsing.
Closes #10284.