Skip to content

Commit 63cad19

Browse files
committed
---
yaml --- r: 152190 b: refs/heads/try2 c: ba9be0a h: refs/heads/master v: v3
1 parent 3fb5fa6 commit 63cad19

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 19fe4aad684bc04a9be0c4fc12aeca12353dae1d
8+
refs/heads/try2: ba9be0a72bd4aabb67e9b72edd261b2fe449dc86
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustdoc/clean/mod.rs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,19 @@ impl Clean<TyParamBound> for ast::TyParamBound {
400400
}
401401
}
402402

403-
fn external_path(name: &str) -> Path {
403+
fn external_path(name: &str, substs: &ty::substs) -> Path {
404404
Path {
405405
global: false,
406406
segments: vec![PathSegment {
407407
name: name.to_string(),
408-
lifetimes: Vec::new(),
409-
types: Vec::new(),
410-
}]
408+
lifetimes: match substs.regions {
409+
ty::ErasedRegions => Vec::new(),
410+
ty::NonerasedRegions(ref v) => {
411+
v.iter().filter_map(|v| v.clean()).collect()
412+
}
413+
},
414+
types: substs.tps.clean(),
415+
}],
411416
}
412417
}
413418

@@ -418,16 +423,21 @@ impl Clean<TyParamBound> for ty::BuiltinBound {
418423
core::Typed(ref tcx) => tcx,
419424
core::NotTyped(_) => return RegionBound,
420425
};
426+
let empty = ty::substs::empty();
421427
let (did, path) = match *self {
422428
ty::BoundStatic => return RegionBound,
423429
ty::BoundSend =>
424-
(tcx.lang_items.send_trait().unwrap(), external_path("Send")),
430+
(tcx.lang_items.send_trait().unwrap(),
431+
external_path("Send", &empty)),
425432
ty::BoundSized =>
426-
(tcx.lang_items.sized_trait().unwrap(), external_path("Sized")),
433+
(tcx.lang_items.sized_trait().unwrap(),
434+
external_path("Sized", &empty)),
427435
ty::BoundCopy =>
428-
(tcx.lang_items.copy_trait().unwrap(), external_path("Copy")),
436+
(tcx.lang_items.copy_trait().unwrap(),
437+
external_path("Copy", &empty)),
429438
ty::BoundShare =>
430-
(tcx.lang_items.share_trait().unwrap(), external_path("Share")),
439+
(tcx.lang_items.share_trait().unwrap(),
440+
external_path("Share", &empty)),
431441
};
432442
let fqn = csearch::get_item_path(tcx, did);
433443
let fqn = fqn.move_iter().map(|i| i.to_str().to_string()).collect();
@@ -451,7 +461,8 @@ impl Clean<TyParamBound> for ty::TraitRef {
451461
let fqn = csearch::get_item_path(tcx, self.def_id);
452462
let fqn = fqn.move_iter().map(|i| i.to_str().to_string())
453463
.collect::<Vec<String>>();
454-
let path = external_path(fqn.last().unwrap().as_slice());
464+
let path = external_path(fqn.last().unwrap().as_slice(),
465+
&self.substs);
455466
cx.external_paths.borrow_mut().get_mut_ref().insert(self.def_id,
456467
(fqn, TypeTrait));
457468
TraitBound(ResolvedPath {
@@ -1040,26 +1051,16 @@ impl Clean<Type> for ty::t {
10401051
let fqn: Vec<String> = fqn.move_iter().map(|i| {
10411052
i.to_str().to_string()
10421053
}).collect();
1043-
let mut path = external_path(fqn.last()
1044-
.unwrap()
1045-
.to_str()
1046-
.as_slice());
10471054
let kind = match ty::get(*self).sty {
10481055
ty::ty_struct(..) => TypeStruct,
10491056
ty::ty_trait(..) => TypeTrait,
10501057
_ => TypeEnum,
10511058
};
1052-
path.segments.get_mut(0).lifetimes = match substs.regions {
1053-
ty::ErasedRegions => Vec::new(),
1054-
ty::NonerasedRegions(ref v) => {
1055-
v.iter().filter_map(|v| v.clean()).collect()
1056-
}
1057-
};
1058-
path.segments.get_mut(0).types = substs.tps.clean();
10591059
cx.external_paths.borrow_mut().get_mut_ref().insert(did,
10601060
(fqn, kind));
10611061
ResolvedPath {
1062-
path: path,
1062+
path: external_path(fqn.last().unwrap().to_str().as_slice(),
1063+
substs),
10631064
typarams: None,
10641065
did: did,
10651066
}

0 commit comments

Comments
 (0)