@@ -283,31 +283,17 @@ fn clean_lifetime<'tcx>(lifetime: &hir::Lifetime, cx: &mut DocContext<'tcx>) ->
283
283
284
284
pub ( crate ) fn clean_const < ' tcx > (
285
285
constant : & hir:: ConstArg < ' _ > ,
286
- cx : & mut DocContext < ' tcx > ,
286
+ _cx : & mut DocContext < ' tcx > ,
287
287
) -> Constant {
288
- let def_id = cx. tcx . hir ( ) . body_owner_def_id ( constant. value . body ) . to_def_id ( ) ;
289
- Constant {
290
- type_ : Box :: new ( clean_middle_ty (
291
- ty:: Binder :: dummy ( cx. tcx . type_of ( def_id) . instantiate_identity ( ) ) ,
292
- cx,
293
- Some ( def_id) ,
294
- None ,
295
- ) ) ,
296
- generics : Generics :: default ( ) ,
297
- kind : ConstantKind :: Anonymous { body : constant. value . body } ,
298
- }
288
+ Constant { kind : ConstantKind :: Anonymous { body : constant. value . body } }
299
289
}
300
290
301
291
pub ( crate ) fn clean_middle_const < ' tcx > (
302
292
constant : ty:: Binder < ' tcx , ty:: Const < ' tcx > > ,
303
- cx : & mut DocContext < ' tcx > ,
293
+ _cx : & mut DocContext < ' tcx > ,
304
294
) -> Constant {
305
295
// FIXME: instead of storing the stringified expression, store `self` directly instead.
306
- Constant {
307
- type_ : Box :: new ( clean_middle_ty ( constant. map_bound ( |c| c. ty ( ) ) , cx, None , None ) ) ,
308
- generics : Generics :: default ( ) ,
309
- kind : ConstantKind :: TyConst { expr : constant. skip_binder ( ) . to_string ( ) . into ( ) } ,
310
- }
296
+ Constant { kind : ConstantKind :: TyConst { expr : constant. skip_binder ( ) . to_string ( ) . into ( ) } }
311
297
}
312
298
313
299
pub ( crate ) fn clean_middle_region < ' tcx > ( region : ty:: Region < ' tcx > ) -> Option < Lifetime > {
@@ -2738,11 +2724,11 @@ fn clean_maybe_renamed_item<'tcx>(
2738
2724
ItemKind :: Static ( ty, mutability, body_id) => {
2739
2725
StaticItem ( Static { type_ : clean_ty ( ty, cx) , mutability, expr : Some ( body_id) } )
2740
2726
}
2741
- ItemKind :: Const ( ty, generics, body_id) => ConstantItem ( Constant {
2742
- type_ : Box :: new ( clean_ty ( ty , cx) ) ,
2743
- generics : clean_generics ( generics , cx) ,
2744
- kind : ConstantKind :: Local { body : body_id, def_id } ,
2745
- } ) ,
2727
+ ItemKind :: Const ( ty, generics, body_id) => ConstantItem (
2728
+ clean_generics ( generics , cx) ,
2729
+ Box :: new ( clean_ty ( ty , cx) ) ,
2730
+ Constant { kind : ConstantKind :: Local { body : body_id, def_id } } ,
2731
+ ) ,
2746
2732
ItemKind :: OpaqueTy ( ref ty) => OpaqueTyItem ( OpaqueTy {
2747
2733
bounds : ty. bounds . iter ( ) . filter_map ( |x| clean_generic_bound ( x, cx) ) . collect ( ) ,
2748
2734
generics : clean_generics ( ty. generics , cx) ,
0 commit comments