mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
Rollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomez
rustdoc: do not write `{{root}}` in `pub use ::foo` docs Fixes #95873
This commit is contained in:
commit
875b22ff30
@ -18,6 +18,7 @@ use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::ty;
|
||||
use rustc_middle::ty::DefIdTree;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::symbol::kw;
|
||||
use rustc_span::{sym, Symbol};
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
||||
@ -679,7 +680,7 @@ fn resolved_path<'cx>(
|
||||
|
||||
if print_all {
|
||||
for seg in &path.segments[..path.segments.len() - 1] {
|
||||
write!(w, "{}::", seg.name)?;
|
||||
write!(w, "{}::", if seg.name == kw::PathRoot { "" } else { seg.name.as_str() })?;
|
||||
}
|
||||
}
|
||||
if w.alternate() {
|
||||
|
2
src/test/rustdoc/issue-95873.rs
Normal file
2
src/test/rustdoc/issue-95873.rs
Normal file
@ -0,0 +1,2 @@
|
||||
// @has issue_95873/index.html "//*[@class='item-left import-item']" "pub use ::std as x;"
|
||||
pub use ::std as x;
|
Loading…
Reference in New Issue
Block a user