-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc renders renamed imports using the new name #81141
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I don't think this should be changed until #42066 is fixed. Otherwise you could have two items shown with the same name and namespace in the same scope. |
Code to reproduce: use core::time::Duration as Alias;
pub fn bar() -> Alias {
Alias::new(0, 0)
} I don't think we need to wait for #42066 to be fixed as the fix for this doesn't impact it: if the re-export is not publicly reexported, we simply show the item underneath. When we will fix #42066, it will handle it the same. |
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 7, 2023
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 7, 2023
…ath, r=notriddle,fmease [rustdoc] If re-export is private, get the next item until a public one is found or expose the private item directly Fixes rust-lang#81141. If we have: ```rust use Private as Something; pub fn foo() -> Something {} ``` Then `Something` will be replaced by `Private`. r? `@notriddle`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 7, 2023
…ath, r=notriddle,fmease [rustdoc] If re-export is private, get the next item until a public one is found or expose the private item directly Fixes rust-lang#81141. If we have: ```rust use Private as Something; pub fn foo() -> Something {} ``` Then `Something` will be replaced by `Private`. r? ``@notriddle``
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 7, 2023
…ath, r=notriddle,fmease [rustdoc] If re-export is private, get the next item until a public one is found or expose the private item directly Fixes rust-lang#81141. If we have: ```rust use Private as Something; pub fn foo() -> Something {} ``` Then `Something` will be replaced by `Private`. r? ```@notriddle```
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 8, 2023
…ath, r=notriddle,fmease [rustdoc] If re-export is private, get the next item until a public one is found or expose the private item directly Fixes rust-lang#81141. If we have: ```rust use Private as Something; pub fn foo() -> Something {} ``` Then `Something` will be replaced by `Private`. r? ````@notriddle````
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Jul 8, 2023
…ath, r=notriddle,fmease [rustdoc] If re-export is private, get the next item until a public one is found or expose the private item directly Fixes rust-lang#81141. If we have: ```rust use Private as Something; pub fn foo() -> Something {} ``` Then `Something` will be replaced by `Private`. r? `````@notriddle`````
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 9, 2023
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 25, 2023
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Uh oh!
There was an error while loading. Please reload this page.
rustdoc renders renamed imports (
use foo as bar;
) using the new, private name(e.g.,
bar
inuse foo as bar;
). This is confusing behavior since the newname is an implementation detail. I think it should be using the original
item's name instead.
As an example,
chrono::Date::signed_duration_since
returns aDuration
, butthe module it's defined in renames
Duration
toOldDuration
. I would expectrustdoc to still show the item's definition name, but instead it shows the
private
OldDuration
name.The text was updated successfully, but these errors were encountered: