@@ -129,7 +129,7 @@ pub fn record_extern_fqn(cx: &core::DocContext,
129
129
match cx. maybe_typed {
130
130
core:: Typed ( ref tcx) => {
131
131
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 ( ) ;
133
133
cx. external_paths . borrow_mut ( ) . get_mut_ref ( ) . insert ( did, ( fqn, kind) ) ;
134
134
}
135
135
core:: NotTyped ( ..) => { }
@@ -138,10 +138,18 @@ pub fn record_extern_fqn(cx: &core::DocContext,
138
138
139
139
pub fn build_external_trait ( tcx : & ty:: ctxt , did : ast:: DefId ) -> clean:: Trait {
140
140
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
+ } ) ;
142
150
clean:: Trait {
143
151
generics : def. generics . clean ( ) ,
144
- methods : methods. iter ( ) . map ( |i| i . clean ( ) ) . collect ( ) ,
152
+ methods : methods. collect ( ) ,
145
153
parents : Vec :: new ( ) , // FIXME: this is likely wrong
146
154
}
147
155
}
@@ -263,10 +271,7 @@ fn build_impl(cx: &core::DocContext,
263
271
if method. vis != ast:: Public && associated_trait. is_none ( ) {
264
272
return None
265
273
}
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 ( ) ;
270
275
item. inner = match item. inner . clone ( ) {
271
276
clean:: TyMethodItem ( clean:: TyMethod {
272
277
fn_style, decl, self_, generics
0 commit comments