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:
Dylan DPC 2022-04-27 02:47:11 +02:00 committed by GitHub
commit 875b22ff30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -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() {

View 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;