@@ -1122,7 +1122,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11221122 AssocItemConstraintKind :: Equality { term } => {
11231123 let term = match term {
11241124 Term :: Ty ( ty) => self . lower_ty_and_intern ( ty, itctx) . into ( ) ,
1125- Term :: Const ( c) => self . lower_anon_const_to_const_arg ( c) . into ( ) ,
1125+ Term :: Const ( c) => self . lower_anon_const_to_const_arg_and_intern ( c) . into ( ) ,
11261126 } ;
11271127 hir:: AssocItemConstraintKind :: Equality { term }
11281128 }
@@ -1248,9 +1248,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
12481248 }
12491249 GenericArg :: Type ( self . lower_ty_and_intern ( ty, itctx) . try_as_ambig_ty ( ) . unwrap ( ) )
12501250 }
1251- ast:: GenericArg :: Const ( ct) => {
1252- GenericArg :: Const ( self . lower_anon_const_to_const_arg ( ct) . try_as_ambig_ct ( ) . unwrap ( ) )
1253- }
1251+ ast:: GenericArg :: Const ( ct) => GenericArg :: Const (
1252+ self . lower_anon_const_to_const_arg_and_intern ( ct) . try_as_ambig_ct ( ) . unwrap ( ) ,
1253+ ) ,
12541254 }
12551255 }
12561256
@@ -2063,7 +2063,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20632063 false
20642064 }
20652065 } )
2066- . map ( |def| self . lower_anon_const_to_const_arg ( def) ) ;
2066+ . map ( |def| self . lower_anon_const_to_const_arg_and_intern ( def) ) ;
20672067
20682068 (
20692069 hir:: ParamName :: Plain ( self . lower_ident ( param. ident ) ) ,
@@ -2285,7 +2285,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22852285 let ct_kind = hir:: ConstArgKind :: Infer ( self . lower_span ( c. value . span ) , ( ) ) ;
22862286 self . arena . alloc ( hir:: ConstArg { hir_id : self . lower_node_id ( c. id ) , kind : ct_kind } )
22872287 }
2288- _ => self . lower_anon_const_to_const_arg ( c) ,
2288+ _ => self . lower_anon_const_to_const_arg_and_intern ( c) ,
22892289 }
22902290 }
22912291
@@ -2364,7 +2364,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
23642364 ) -> hir:: ConstItemRhs < ' hir > {
23652365 match rhs {
23662366 Some ( ConstItemRhs :: TypeConst ( anon) ) => {
2367- hir:: ConstItemRhs :: TypeConst ( self . lower_anon_const_to_const_arg ( anon) )
2367+ hir:: ConstItemRhs :: TypeConst ( self . lower_anon_const_to_const_arg_and_intern ( anon) )
23682368 }
23692369 None if attr:: contains_name ( attrs, sym:: type_const) => {
23702370 let const_arg = ConstArg {
@@ -2432,12 +2432,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
24322432
24332433 /// See [`hir::ConstArg`] for when to use this function vs
24342434 /// [`Self::lower_anon_const_to_anon_const`].
2435- fn lower_anon_const_to_const_arg ( & mut self , anon : & AnonConst ) -> & ' hir hir:: ConstArg < ' hir > {
2436- self . arena . alloc ( self . lower_anon_const_to_const_arg_direct ( anon) )
2435+ fn lower_anon_const_to_const_arg_and_intern (
2436+ & mut self ,
2437+ anon : & AnonConst ,
2438+ ) -> & ' hir hir:: ConstArg < ' hir > {
2439+ self . arena . alloc ( self . lower_anon_const_to_const_arg ( anon) )
24372440 }
24382441
24392442 #[ instrument( level = "debug" , skip( self ) ) ]
2440- fn lower_anon_const_to_const_arg_direct ( & mut self , anon : & AnonConst ) -> hir:: ConstArg < ' hir > {
2443+ fn lower_anon_const_to_const_arg ( & mut self , anon : & AnonConst ) -> hir:: ConstArg < ' hir > {
24412444 let tcx = self . tcx ;
24422445
24432446 // We cannot change parsing depending on feature gates available,
0 commit comments