Skip to content

Commit 463ed19

Browse files
committed
---
yaml --- r: 152263 b: refs/heads/try2 c: f02f739 h: refs/heads/master i: 152261: 180a065 152259: 5e5ccad 152255: 85eb353 v: v3
1 parent 08b0c69 commit 463ed19

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
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: 287af7fa1a2230b25d2ffe98c5cc623ad34c6287
8+
refs/heads/try2: f02f739a825219a4bb5d12df2f646ea67c434a33
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/inline.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn record_extern_fqn(cx: &core::DocContext,
129129
match cx.maybe_typed {
130130
core::Typed(ref tcx) => {
131131
let fqn = csearch::get_item_path(tcx, did);
132-
let fqn = fqn.move_iter().map(|i| i.to_str().to_string()).collect();
132+
let fqn = fqn.move_iter().map(|i| i.to_str()).collect();
133133
cx.external_paths.borrow_mut().get_mut_ref().insert(did, (fqn, kind));
134134
}
135135
core::NotTyped(..) => {}
@@ -138,10 +138,18 @@ pub fn record_extern_fqn(cx: &core::DocContext,
138138

139139
pub fn build_external_trait(tcx: &ty::ctxt, did: ast::DefId) -> clean::Trait {
140140
let def = ty::lookup_trait_def(tcx, did);
141-
let methods = ty::trait_methods(tcx, did);
141+
let methods = ty::trait_methods(tcx, did).clean();
142+
let provided = ty::provided_trait_methods(tcx, did);
143+
let mut methods = methods.move_iter().map(|meth| {
144+
if provided.iter().any(|a| a.def_id == meth.def_id) {
145+
clean::Provided(meth)
146+
} else {
147+
clean::Required(meth)
148+
}
149+
});
142150
clean::Trait {
143151
generics: def.generics.clean(),
144-
methods: methods.iter().map(|i| i.clean()).collect(),
152+
methods: methods.collect(),
145153
parents: Vec::new(), // FIXME: this is likely wrong
146154
}
147155
}
@@ -263,10 +271,7 @@ fn build_impl(cx: &core::DocContext,
263271
if method.vis != ast::Public && associated_trait.is_none() {
264272
return None
265273
}
266-
let mut item = match ty::method(tcx, *did).clean() {
267-
clean::Provided(item) => item,
268-
clean::Required(item) => item,
269-
};
274+
let mut item = ty::method(tcx, *did).clean();
270275
item.inner = match item.inner.clone() {
271276
clean::TyMethodItem(clean::TyMethod {
272277
fn_style, decl, self_, generics

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -942,9 +942,8 @@ impl Clean<TraitMethod> for ast::TraitMethod {
942942
}
943943
}
944944

945-
impl Clean<TraitMethod> for ty::Method {
946-
fn clean(&self) -> TraitMethod {
947-
let m = if self.provided_source.is_some() {Provided} else {Required};
945+
impl Clean<Item> for ty::Method {
946+
fn clean(&self) -> Item {
948947
let cx = super::ctxtkey.get().unwrap();
949948
let tcx = match cx.maybe_typed {
950949
core::Typed(ref tcx) => tcx,
@@ -972,7 +971,7 @@ impl Clean<TraitMethod> for ty::Method {
972971
}
973972
};
974973

975-
m(Item {
974+
Item {
976975
name: Some(self.ident.clean()),
977976
visibility: Some(ast::Inherited),
978977
def_id: self.def_id,
@@ -984,7 +983,7 @@ impl Clean<TraitMethod> for ty::Method {
984983
self_: self_,
985984
decl: (self.def_id, &sig).clean(),
986985
})
987-
})
986+
}
988987
}
989988
}
990989

0 commit comments

Comments
 (0)