Skip to content

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

Closed
@kpreid

Description

@kpreid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions