-
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
rustdoc renders renamed imports using the new name #81141
Comments
camelid
added
C-bug
Category: This is a bug.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
labels
Jan 18, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: