@@ -47,6 +47,7 @@ use rustc_data_structures::fingerprint::Fingerprint;
4747use rustc_data_structures:: sorted_map:: SortedMap ;
4848use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
4949use rustc_data_structures:: sync:: Lrc ;
50+ use rustc_data_structures:: tagged_ptr:: CovariantCopyTaggedPtr ;
5051use rustc_errors:: { DiagArgFromDisplay , DiagCtxtHandle , StashKey } ;
5152use rustc_hir:: def:: { DefKind , LifetimeRes , Namespace , PartialRes , PerNS , Res } ;
5253use rustc_hir:: def_id:: { CRATE_DEF_ID , LOCAL_CRATE , LocalDefId } ;
@@ -1083,7 +1084,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
10831084 ast:: GenericArg :: Lifetime ( lt) => GenericArg :: Lifetime ( self . lower_lifetime ( lt) ) ,
10841085 ast:: GenericArg :: Type ( ty) => {
10851086 match & ty. kind {
1086- TyKind :: Infer if self . tcx . features ( ) . generic_arg_infer ( ) => {
1087+ TyKind :: Infer => {
10871088 return GenericArg :: Infer ( hir:: InferArg {
10881089 hir_id : self . lower_node_id ( ty. id ) ,
10891090 span : self . lower_span ( ty. span ) ,
@@ -1109,15 +1110,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11091110
11101111 let ct =
11111112 self . lower_const_path_to_const_arg ( path, res, ty. id , ty. span ) ;
1112- return GenericArg :: Const ( ct) ;
1113+ return GenericArg :: Const ( ct. as_ambig_ct ( ) ) ;
11131114 }
11141115 }
11151116 }
11161117 _ => { }
11171118 }
1118- GenericArg :: Type ( self . lower_ty ( ty, itctx) )
1119+ GenericArg :: Type ( self . lower_ty ( ty, itctx) . as_ambig_ty ( ) )
1120+ }
1121+ ast:: GenericArg :: Const ( ct) => {
1122+ GenericArg :: Const ( self . lower_anon_const_to_const_arg ( ct) . as_ambig_ct ( ) )
11191123 }
1120- ast:: GenericArg :: Const ( ct) => GenericArg :: Const ( self . lower_anon_const_to_const_arg ( ct) ) ,
11211124 }
11221125 }
11231126
@@ -1157,7 +1160,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11571160 let lifetime_bound = this. elided_dyn_bound ( t. span ) ;
11581161 ( bounds, lifetime_bound)
11591162 } ) ;
1160- let kind = hir:: TyKind :: TraitObject ( bounds, lifetime_bound, TraitObjectSyntax :: None ) ;
1163+ let kind = hir:: TyKind :: TraitObject (
1164+ bounds,
1165+ CovariantCopyTaggedPtr :: new ( lifetime_bound, TraitObjectSyntax :: None ) ,
1166+ ) ;
11611167 return hir:: Ty { kind, span : self . lower_span ( t. span ) , hir_id : self . next_id ( ) } ;
11621168 }
11631169
@@ -1184,7 +1190,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11841190
11851191 fn lower_ty_direct ( & mut self , t : & Ty , itctx : ImplTraitContext ) -> hir:: Ty < ' hir > {
11861192 let kind = match & t. kind {
1187- TyKind :: Infer => hir:: TyKind :: Infer ,
1193+ TyKind :: Infer => hir:: TyKind :: Infer ( ( ) ) ,
11881194 TyKind :: Err ( guar) => hir:: TyKind :: Err ( * guar) ,
11891195 TyKind :: Slice ( ty) => hir:: TyKind :: Slice ( self . lower_ty ( ty, itctx) ) ,
11901196 TyKind :: Ptr ( mt) => hir:: TyKind :: Ptr ( self . lower_mt ( mt, itctx) ) ,
@@ -1308,7 +1314,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13081314 lifetime_bound. unwrap_or_else ( || this. elided_dyn_bound ( t. span ) ) ;
13091315 ( bounds, lifetime_bound)
13101316 } ) ;
1311- hir:: TyKind :: TraitObject ( bounds, lifetime_bound, * kind)
1317+ hir:: TyKind :: TraitObject ( bounds, CovariantCopyTaggedPtr :: new ( lifetime_bound, * kind) )
13121318 }
13131319 TyKind :: ImplTrait ( def_node_id, bounds) => {
13141320 let span = t. span ;
@@ -2040,7 +2046,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20402046 )
20412047 . stash ( c. value . span , StashKey :: UnderscoreForArrayLengths ) ;
20422048 }
2043- let ct_kind = hir:: ConstArgKind :: Infer ( self . lower_span ( c. value . span ) ) ;
2049+ let ct_kind = hir:: ConstArgKind :: Infer ( self . lower_span ( c. value . span ) , ( ) ) ;
20442050 self . arena . alloc ( hir:: ConstArg { hir_id : self . lower_node_id ( c. id ) , kind : ct_kind } )
20452051 }
20462052 _ => self . lower_anon_const_to_const_arg ( c) ,
@@ -2364,8 +2370,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
23642370 hir_id = self . next_id ( ) ;
23652371 hir:: TyKind :: TraitObject (
23662372 arena_vec ! [ self ; principal] ,
2367- self . elided_dyn_bound ( span) ,
2368- TraitObjectSyntax :: None ,
2373+ CovariantCopyTaggedPtr :: new (
2374+ self . elided_dyn_bound ( span) ,
2375+ TraitObjectSyntax :: None ,
2376+ ) ,
23692377 )
23702378 }
23712379 _ => hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , path) ) ,
0 commit comments