@@ -56,7 +56,7 @@ crate fn try_inline(
56
56
let kind = match res {
57
57
Res :: Def ( DefKind :: Trait , did) => {
58
58
record_extern_fqn ( cx, did, clean:: TypeKind :: Trait ) ;
59
- ret . extend ( build_impls ( cx, Some ( parent_module) , did, attrs) ) ;
59
+ build_impls ( cx, Some ( parent_module) , did, attrs, & mut ret ) ;
60
60
clean:: TraitItem ( build_external_trait ( cx, did) )
61
61
}
62
62
Res :: Def ( DefKind :: Fn , did) => {
@@ -65,27 +65,27 @@ crate fn try_inline(
65
65
}
66
66
Res :: Def ( DefKind :: Struct , did) => {
67
67
record_extern_fqn ( cx, did, clean:: TypeKind :: Struct ) ;
68
- ret . extend ( build_impls ( cx, Some ( parent_module) , did, attrs) ) ;
68
+ build_impls ( cx, Some ( parent_module) , did, attrs, & mut ret ) ;
69
69
clean:: StructItem ( build_struct ( cx, did) )
70
70
}
71
71
Res :: Def ( DefKind :: Union , did) => {
72
72
record_extern_fqn ( cx, did, clean:: TypeKind :: Union ) ;
73
- ret . extend ( build_impls ( cx, Some ( parent_module) , did, attrs) ) ;
73
+ build_impls ( cx, Some ( parent_module) , did, attrs, & mut ret ) ;
74
74
clean:: UnionItem ( build_union ( cx, did) )
75
75
}
76
76
Res :: Def ( DefKind :: TyAlias , did) => {
77
77
record_extern_fqn ( cx, did, clean:: TypeKind :: Typedef ) ;
78
- ret . extend ( build_impls ( cx, Some ( parent_module) , did, attrs) ) ;
78
+ build_impls ( cx, Some ( parent_module) , did, attrs, & mut ret ) ;
79
79
clean:: TypedefItem ( build_type_alias ( cx, did) , false )
80
80
}
81
81
Res :: Def ( DefKind :: Enum , did) => {
82
82
record_extern_fqn ( cx, did, clean:: TypeKind :: Enum ) ;
83
- ret . extend ( build_impls ( cx, Some ( parent_module) , did, attrs) ) ;
83
+ build_impls ( cx, Some ( parent_module) , did, attrs, & mut ret ) ;
84
84
clean:: EnumItem ( build_enum ( cx, did) )
85
85
}
86
86
Res :: Def ( DefKind :: ForeignTy , did) => {
87
87
record_extern_fqn ( cx, did, clean:: TypeKind :: Foreign ) ;
88
- ret . extend ( build_impls ( cx, Some ( parent_module) , did, attrs) ) ;
88
+ build_impls ( cx, Some ( parent_module) , did, attrs, & mut ret ) ;
89
89
clean:: ForeignTypeItem
90
90
}
91
91
// Never inline enum variants but leave them shown as re-exports.
@@ -277,16 +277,14 @@ crate fn build_impls(
277
277
parent_module : Option < DefId > ,
278
278
did : DefId ,
279
279
attrs : Option < Attrs < ' _ > > ,
280
- ) -> Vec < clean:: Item > {
280
+ ret : & mut Vec < clean:: Item > ,
281
+ ) {
281
282
let tcx = cx. tcx ;
282
- let mut impls = Vec :: new ( ) ;
283
283
284
284
// for each implementation of an item represented by `did`, build the clean::Item for that impl
285
285
for & did in tcx. inherent_impls ( did) . iter ( ) {
286
- build_impl ( cx, parent_module, did, attrs, & mut impls ) ;
286
+ build_impl ( cx, parent_module, did, attrs, ret ) ;
287
287
}
288
-
289
- impls
290
288
}
291
289
292
290
/// `parent_module` refers to the parent of the re-export, not the original item
0 commit comments