@@ -199,7 +199,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
199
199
|this| {
200
200
let ty = this
201
201
. lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
202
- let body = this. lower_const_item ( body. as_deref ( ) . unwrap ( ) ) ;
202
+ let body = this. lower_anon_const_to_const_arg ( body. as_deref ( ) . unwrap ( ) ) ;
203
203
( ty, body)
204
204
} ,
205
205
) ;
@@ -484,16 +484,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
484
484
}
485
485
}
486
486
487
- fn lower_const_item ( & mut self , body : & AnonConst ) -> & ' hir hir:: ConstArg < ' hir > {
488
- let mgca = self . tcx . features ( ) . min_generic_const_args ( ) ;
489
- if mgca && let Some ( ct_arg) = self . try_lower_as_const_path ( body) {
490
- return ct_arg;
491
- }
492
- let anon = self . lower_anon_const_to_anon_const ( body) ;
493
- self . arena
494
- . alloc ( hir:: ConstArg { hir_id : self . next_id ( ) , kind : hir:: ConstArgKind :: Anon ( anon) } )
495
- }
496
-
497
487
#[ instrument( level = "debug" , skip( self ) ) ]
498
488
fn lower_use_tree (
499
489
& mut self ,
@@ -800,7 +790,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
800
790
|this| {
801
791
let ty = this
802
792
. lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
803
- let body = body. as_deref ( ) . map ( |body| this. lower_const_item ( body) ) ;
793
+ let body =
794
+ body. as_deref ( ) . map ( |body| this. lower_anon_const_to_const_arg ( body) ) ;
804
795
hir:: TraitItemKind :: Const ( ty, body)
805
796
} ,
806
797
) ;
@@ -993,7 +984,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
993
984
let ty = this
994
985
. lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
995
986
this. lower_define_opaque ( hir_id, & define_opaque) ;
996
- let body = this. lower_const_item ( body. as_deref ( ) . unwrap ( ) ) ;
987
+ let body = this. lower_anon_const_to_const_arg ( body. as_deref ( ) . unwrap ( ) ) ;
997
988
hir:: ImplItemKind :: Const ( ty, body)
998
989
} ,
999
990
) ,
0 commit comments