@@ -283,31 +283,17 @@ fn clean_lifetime<'tcx>(lifetime: &hir::Lifetime, cx: &mut DocContext<'tcx>) ->
283283
284284pub ( crate ) fn clean_const < ' tcx > (
285285 constant : & hir:: ConstArg < ' _ > ,
286- cx : & mut DocContext < ' tcx > ,
286+ _cx : & mut DocContext < ' tcx > ,
287287) -> 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 } }
299289}
300290
301291pub ( crate ) fn clean_middle_const < ' tcx > (
302292 constant : ty:: Binder < ' tcx , ty:: Const < ' tcx > > ,
303- cx : & mut DocContext < ' tcx > ,
293+ _cx : & mut DocContext < ' tcx > ,
304294) -> Constant {
305295 // 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 ( ) } }
311297}
312298
313299pub ( crate ) fn clean_middle_region < ' tcx > ( region : ty:: Region < ' tcx > ) -> Option < Lifetime > {
@@ -2738,11 +2724,11 @@ fn clean_maybe_renamed_item<'tcx>(
27382724 ItemKind :: Static ( ty, mutability, body_id) => {
27392725 StaticItem ( Static { type_ : clean_ty ( ty, cx) , mutability, expr : Some ( body_id) } )
27402726 }
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+ ) ,
27462732 ItemKind :: OpaqueTy ( ref ty) => OpaqueTyItem ( OpaqueTy {
27472733 bounds : ty. bounds . iter ( ) . filter_map ( |x| clean_generic_bound ( x, cx) ) . collect ( ) ,
27482734 generics : clean_generics ( ty. generics , cx) ,
0 commit comments