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

This commit is contained in:
Michael Howell 2022-04-25 15:38:43 -07:00
parent 7417110cef
commit ae38f35720
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@
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 '{{root}}'
pub use ::std as x;