Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d91946b

Browse files
committed
Remove Path.global
1 parent 6dc08b9 commit d91946b

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ fn build_module(
526526
item.ident.name,
527527
clean::ImportSource {
528528
path: clean::Path {
529-
global: false,
530529
res,
531530
segments: vec![clean::PathSegment {
532531
name: prim_ty.as_sym(),

src/librustdoc/clean/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,6 @@ fn clean_qpath(hir_ty: &hir::Ty<'_>, cx: &mut DocContext<'_>) -> Type {
12771277
let trait_segments = &segments[..segments.len() - 1];
12781278
let trait_def = cx.tcx.associated_item(p.res.def_id()).container.id();
12791279
let trait_path = self::Path {
1280-
global: p.is_global(),
12811280
res: Res::Def(DefKind::Trait, trait_def),
12821281
segments: trait_segments.clean(cx),
12831282
};
@@ -1728,11 +1727,7 @@ impl Clean<Variant> for hir::VariantData<'_> {
17281727

17291728
impl Clean<Path> for hir::Path<'_> {
17301729
fn clean(&self, cx: &mut DocContext<'_>) -> Path {
1731-
Path {
1732-
global: self.is_global(),
1733-
res: self.res,
1734-
segments: if self.is_global() { &self.segments[1..] } else { &self.segments }.clean(cx),
1735-
}
1730+
Path { res: self.res, segments: self.segments.clean(cx) }
17361731
}
17371732
}
17381733

src/librustdoc/clean/types.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,6 @@ impl Span {
19671967

19681968
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
19691969
crate struct Path {
1970-
crate global: bool,
19711970
crate res: Res,
19721971
crate segments: Vec<PathSegment>,
19731972
}
@@ -1982,8 +1981,7 @@ impl Path {
19821981
}
19831982

19841983
crate fn whole_name(&self) -> String {
1985-
String::from(if self.global { "::" } else { "" })
1986-
+ &self.segments.iter().map(|s| s.name.to_string()).collect::<Vec<_>>().join("::")
1984+
self.segments.iter().map(|s| s.name.to_string()).collect::<Vec<_>>().join("::")
19871985
}
19881986

19891987
/// Checks if this is a `T::Name` path for an associated type.

src/librustdoc/clean/utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ pub(super) fn external_path(
148148
let def_kind = cx.tcx.def_kind(did);
149149
let name = cx.tcx.item_name(did);
150150
Path {
151-
global: false,
152151
res: Res::Def(def_kind, did),
153152
segments: vec![PathSegment {
154153
name,
@@ -199,7 +198,7 @@ crate fn strip_path(path: &Path) -> Path {
199198
})
200199
.collect();
201200

202-
Path { global: path.global, res: path.res, segments }
201+
Path { res: path.res, segments }
203202
}
204203

205204
crate fn qpath_to_string(p: &hir::QPath<'_>) -> String {

0 commit comments

Comments
 (0)