-
Notifications
You must be signed in to change notification settings - Fork 13k
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: rename the type in an impl to match its containing page #56013
rustdoc: rename the type in an impl to match its containing page #56013
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Thanks! @bors: r+ |
📌 Commit 002b000 has been approved by |
I guess this is trying to fix #41072 and #42675. However it isn't complete as the old name still appears in methods signatures and generic parameters. The bigger issue is that the mod inner {
pub struct SomeStruct;
impl SomeStruct {
pub fn new() -> SomeStruct { SomeStruct }
}
impl From<SomeStruct> for Vec<u8> {
fn from(x: SomeStruct) -> Vec<u8> {
Vec::new()
}
}
}
pub use inner::SomeStruct as MyStruct; results in: with this PR. I think a solution is to look up the last name from @bors r- |
Triage; @QuietMisdreavus Hello, have you been able to get back to this PR? |
Ping from triage @QuietMisdreavus: It looks like some changes have been requested to your PR. |
Sorry! It's been a couple weeks since i ran through my GitHub notifications - starting with American Thanksgiving and following up with a cold - and i ran through all my reviews first. I'll update this PR "Soon ™️". |
@ollie27 So i just tried using |
I think for the time being, i'll close this PR. This needs to go back to the drawing board, but i'll need to revisit it later. |
Currently, if you
pub use Something as SomethingElse
, andSomething
has someimpl
blocks on it, they won't be renamed to matchSomethingElse
, creating confusion if the original type name is not actually public, or expected to be the public API of that type. This leads to situations where the file name, page title, and item definition section will use the name from the re-export, and all the impls will use the original name. This PR changes how we render impls if they come from item pages, so that their name matches their containing item instead of the original declaration.