@@ -122,7 +122,7 @@ impl Clean<ExternalCrate> for CrateNum {
122
122
}
123
123
}
124
124
}
125
- return prim. map ( |p| ( def_id, p, attrs ) ) ;
125
+ return prim. map ( |p| ( def_id, p) ) ;
126
126
}
127
127
None
128
128
} ;
@@ -144,9 +144,9 @@ impl Clean<ExternalCrate> for CrateNum {
144
144
hir:: ItemKind :: Use ( ref path, hir:: UseKind :: Single )
145
145
if item. vis . node . is_pub ( ) =>
146
146
{
147
- as_primitive ( path. res ) . map ( |( _, prim, attrs ) | {
147
+ as_primitive ( path. res ) . map ( |( _, prim) | {
148
148
// Pretend the primitive is local.
149
- ( cx. tcx . hir ( ) . local_def_id ( id. id ) . to_def_id ( ) , prim, attrs )
149
+ ( cx. tcx . hir ( ) . local_def_id ( id. id ) . to_def_id ( ) , prim)
150
150
} )
151
151
}
152
152
_ => None ,
@@ -177,7 +177,7 @@ impl Clean<ExternalCrate> for CrateNum {
177
177
}
178
178
}
179
179
}
180
- return keyword. map ( |p| ( def_id, p, attrs ) ) ;
180
+ return keyword. map ( |p| ( def_id, p) ) ;
181
181
}
182
182
None
183
183
} ;
@@ -199,8 +199,8 @@ impl Clean<ExternalCrate> for CrateNum {
199
199
hir:: ItemKind :: Use ( ref path, hir:: UseKind :: Single )
200
200
if item. vis . node . is_pub ( ) =>
201
201
{
202
- as_keyword ( path. res ) . map ( |( _, prim, attrs ) | {
203
- ( cx. tcx . hir ( ) . local_def_id ( id. id ) . to_def_id ( ) , prim, attrs )
202
+ as_keyword ( path. res ) . map ( |( _, prim) | {
203
+ ( cx. tcx . hir ( ) . local_def_id ( id. id ) . to_def_id ( ) , prim)
204
204
} )
205
205
}
206
206
_ => None ,
@@ -1099,7 +1099,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
1099
1099
AssocTypeItem ( bounds. clean ( cx) , default. clean ( cx) )
1100
1100
}
1101
1101
} ;
1102
- Item :: from_def_id_and_parts ( local_did, Some ( self . ident . name ) , inner, cx)
1102
+ Item :: from_def_id_and_parts ( local_did, Some ( self . ident . name . clean ( cx ) ) , inner, cx)
1103
1103
} )
1104
1104
}
1105
1105
}
@@ -1127,7 +1127,7 @@ impl Clean<Item> for hir::ImplItem<'_> {
1127
1127
TypedefItem ( Typedef { type_, generics : Generics :: default ( ) , item_type } , true )
1128
1128
}
1129
1129
} ;
1130
- Item :: from_def_id_and_parts ( local_did, Some ( self . ident . name ) , inner, cx)
1130
+ Item :: from_def_id_and_parts ( local_did, Some ( self . ident . name . clean ( cx ) ) , inner, cx)
1131
1131
} )
1132
1132
}
1133
1133
}
@@ -1284,7 +1284,7 @@ impl Clean<Item> for ty::AssocItem {
1284
1284
}
1285
1285
} ;
1286
1286
1287
- Item :: from_def_id_and_parts ( self . def_id , Some ( self . ident . name ) , kind, cx)
1287
+ Item :: from_def_id_and_parts ( self . def_id , Some ( self . ident . name . clean ( cx ) ) , kind, cx)
1288
1288
}
1289
1289
}
1290
1290
@@ -1769,7 +1769,7 @@ impl Clean<Item> for ty::FieldDef {
1769
1769
fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
1770
1770
let what_rustc_thinks = Item :: from_def_id_and_parts (
1771
1771
self . did ,
1772
- Some ( self . ident . name ) ,
1772
+ Some ( self . ident . name . clean ( cx ) ) ,
1773
1773
StructFieldItem ( cx. tcx . type_of ( self . did ) . clean ( cx) ) ,
1774
1774
cx,
1775
1775
) ;
@@ -1844,22 +1844,20 @@ impl Clean<Item> for ty::VariantDef {
1844
1844
fields : self
1845
1845
. fields
1846
1846
. iter ( )
1847
- . map ( |field| Item {
1848
- source : cx. tcx . def_span ( field. did ) . clean ( cx) ,
1849
- name : Some ( field. ident . name . clean ( cx) ) ,
1850
- attrs : cx. tcx . get_attrs ( field. did ) . clean ( cx) ,
1851
- visibility : Visibility :: Inherited ,
1852
- def_id : field. did ,
1853
- stability : get_stability ( cx, field. did ) ,
1854
- deprecation : get_deprecation ( cx, field. did ) ,
1855
- kind : StructFieldItem ( cx. tcx . type_of ( field. did ) . clean ( cx) ) ,
1847
+ . map ( |field| {
1848
+ let name = Some ( field. ident . name . clean ( cx) ) ;
1849
+ let kind = StructFieldItem ( cx. tcx . type_of ( field. did ) . clean ( cx) ) ;
1850
+ let what_rustc_thinks =
1851
+ Item :: from_def_id_and_parts ( field. did , name, kind, cx) ;
1852
+ // don't show `pub` for fields, which are always public
1853
+ Item { visibility : Visibility :: Inherited , ..what_rustc_thinks }
1856
1854
} )
1857
1855
. collect ( ) ,
1858
1856
} ) ,
1859
1857
} ;
1860
1858
let what_rustc_thinks = Item :: from_def_id_and_parts (
1861
1859
self . def_id ,
1862
- Some ( self . ident . name ) ,
1860
+ Some ( self . ident . name . clean ( cx ) ) ,
1863
1861
VariantItem ( Variant { kind } ) ,
1864
1862
cx,
1865
1863
) ;
@@ -2057,7 +2055,7 @@ impl Clean<Vec<Item>> for (&hir::Item<'_>, Option<Ident>) {
2057
2055
_ => unreachable ! ( "not yet converted" ) ,
2058
2056
} ;
2059
2057
2060
- vec ! [ Item :: from_def_id_and_parts( def_id, Some ( name) , kind, cx) ]
2058
+ vec ! [ Item :: from_def_id_and_parts( def_id, Some ( name. clean ( cx ) ) , kind, cx) ]
2061
2059
} )
2062
2060
}
2063
2061
}
@@ -2319,7 +2317,7 @@ impl Clean<Item> for doctree::Macro {
2319
2317
fn clean ( & self , cx : & DocContext < ' _ > ) -> Item {
2320
2318
Item :: from_def_id_and_parts (
2321
2319
self . def_id ,
2322
- Some ( self . name ) ,
2320
+ Some ( self . name . clean ( cx ) ) ,
2323
2321
MacroItem ( Macro {
2324
2322
source : format ! (
2325
2323
"macro_rules! {} {{\n {}}}" ,
0 commit comments