Skip to content

Commit b848260

Browse files
committed
---
yaml --- r: 118123 b: refs/heads/try c: ba9be0a h: refs/heads/master i: 118121: 7e761e5 118119: 5b21883 v: v3
1 parent e5b45d6 commit b848260

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 3770c42a4959cbabc73da52abc7e3db96657974e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d6736a1440d42f6af967a8a20ab8d73522112b72
5-
refs/heads/try: 19fe4aad684bc04a9be0c4fc12aeca12353dae1d
5+
refs/heads/try: ba9be0a72bd4aabb67e9b72edd261b2fe449dc86
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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)