Skip to content

rustdoc displays pub use ::foo reexports as pub use {{root}}::foo #95873

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

Closed
kpreid opened this issue Apr 10, 2022 · 0 comments · Fixed by #96410
Closed

rustdoc displays pub use ::foo reexports as pub use {{root}}::foo #95873

kpreid opened this issue Apr 10, 2022 · 0 comments · Fixed by #96410
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@kpreid
Copy link
Contributor

kpreid commented Apr 10, 2022

Generate documentation for a crate containing just:

pub use ::std;

then the documentation shows pub use {{root}}::std;, which seems like some implementation detail leaking into the output. Without the leading ::, it shows pub use std; which is more reasonable and what I expected to get.

(Of course, using std here is just for a self-contained example. It originally happened with a normal Cargo dependency crate.)

Meta

Reproduced on:

rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-apple-darwin
release: 1.60.0
LLVM version: 14.0.0
rustc 1.62.0-nightly (8bf93e9b6 2022-04-09)
binary: rustc
commit-hash: 8bf93e9b6791acee3a594ed202fdfe45ad9952b5
commit-date: 2022-04-09
host: x86_64-apple-darwin
release: 1.62.0-nightly
LLVM version: 14.0.0

@rustbot label +T-rustdoc

@kpreid kpreid added the C-bug Category: This is a bug. label Apr 10, 2022
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 10, 2022
compiler-errors added a commit to compiler-errors/rust that referenced this issue Apr 26, 2022
…GuillaumeGomez

rustdoc: do not write `{{root}}` in `pub use ::foo` docs

Fixes rust-lang#95873
@bors bors closed this as completed in 875b22f Apr 27, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants