@@ -48,6 +48,7 @@ use rustc_data_structures::fingerprint::Fingerprint;
48
48
use rustc_data_structures:: sorted_map:: SortedMap ;
49
49
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
50
50
use rustc_data_structures:: sync:: Lrc ;
51
+ use rustc_data_structures:: tagged_ptr:: CovariantCopyTaggedPtr ;
51
52
use rustc_errors:: { DiagArgFromDisplay , DiagCtxtHandle , StashKey } ;
52
53
use rustc_hir:: def:: { DefKind , LifetimeRes , Namespace , PartialRes , PerNS , Res } ;
53
54
use rustc_hir:: def_id:: { CRATE_DEF_ID , LOCAL_CRATE , LocalDefId } ;
@@ -1084,7 +1085,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1084
1085
ast:: GenericArg :: Lifetime ( lt) => GenericArg :: Lifetime ( self . lower_lifetime ( lt) ) ,
1085
1086
ast:: GenericArg :: Type ( ty) => {
1086
1087
match & ty. kind {
1087
- TyKind :: Infer if self . tcx . features ( ) . generic_arg_infer ( ) => {
1088
+ TyKind :: Infer => {
1088
1089
return GenericArg :: Infer ( hir:: InferArg {
1089
1090
hir_id : self . lower_node_id ( ty. id ) ,
1090
1091
span : self . lower_span ( ty. span ) ,
@@ -1110,15 +1111,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1110
1111
1111
1112
let ct =
1112
1113
self . lower_const_path_to_const_arg ( path, res, ty. id , ty. span ) ;
1113
- return GenericArg :: Const ( ct) ;
1114
+ return GenericArg :: Const ( ct. as_ambig_ct ( ) ) ;
1114
1115
}
1115
1116
}
1116
1117
}
1117
1118
_ => { }
1118
1119
}
1119
- GenericArg :: Type ( self . lower_ty ( ty, itctx) )
1120
+ GenericArg :: Type ( self . lower_ty ( ty, itctx) . as_ambig_ty ( ) )
1121
+ }
1122
+ ast:: GenericArg :: Const ( ct) => {
1123
+ GenericArg :: Const ( self . lower_anon_const_to_const_arg ( ct) . as_ambig_ct ( ) )
1120
1124
}
1121
- ast:: GenericArg :: Const ( ct) => GenericArg :: Const ( self . lower_anon_const_to_const_arg ( ct) ) ,
1122
1125
}
1123
1126
}
1124
1127
@@ -1158,7 +1161,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1158
1161
let lifetime_bound = this. elided_dyn_bound ( t. span ) ;
1159
1162
( bounds, lifetime_bound)
1160
1163
} ) ;
1161
- let kind = hir:: TyKind :: TraitObject ( bounds, lifetime_bound, TraitObjectSyntax :: None ) ;
1164
+ let kind = hir:: TyKind :: TraitObject (
1165
+ bounds,
1166
+ CovariantCopyTaggedPtr :: new ( lifetime_bound, TraitObjectSyntax :: None ) ,
1167
+ ) ;
1162
1168
return hir:: Ty { kind, span : self . lower_span ( t. span ) , hir_id : self . next_id ( ) } ;
1163
1169
}
1164
1170
@@ -1185,7 +1191,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1185
1191
1186
1192
fn lower_ty_direct ( & mut self , t : & Ty , itctx : ImplTraitContext ) -> hir:: Ty < ' hir > {
1187
1193
let kind = match & t. kind {
1188
- TyKind :: Infer => hir:: TyKind :: Infer ,
1194
+ TyKind :: Infer => hir:: TyKind :: Infer ( ( ) ) ,
1189
1195
TyKind :: Err ( guar) => hir:: TyKind :: Err ( * guar) ,
1190
1196
TyKind :: Slice ( ty) => hir:: TyKind :: Slice ( self . lower_ty ( ty, itctx) ) ,
1191
1197
TyKind :: Ptr ( mt) => hir:: TyKind :: Ptr ( self . lower_mt ( mt, itctx) ) ,
@@ -1309,7 +1315,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1309
1315
lifetime_bound. unwrap_or_else ( || this. elided_dyn_bound ( t. span ) ) ;
1310
1316
( bounds, lifetime_bound)
1311
1317
} ) ;
1312
- hir:: TyKind :: TraitObject ( bounds, lifetime_bound, * kind)
1318
+ hir:: TyKind :: TraitObject ( bounds, CovariantCopyTaggedPtr :: new ( lifetime_bound, * kind) )
1313
1319
}
1314
1320
TyKind :: ImplTrait ( def_node_id, bounds) => {
1315
1321
let span = t. span ;
@@ -2041,7 +2047,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2041
2047
)
2042
2048
. stash ( c. value . span , StashKey :: UnderscoreForArrayLengths ) ;
2043
2049
}
2044
- let ct_kind = hir:: ConstArgKind :: Infer ( self . lower_span ( c. value . span ) ) ;
2050
+ let ct_kind = hir:: ConstArgKind :: Infer ( self . lower_span ( c. value . span ) , ( ) ) ;
2045
2051
self . arena . alloc ( hir:: ConstArg { hir_id : self . lower_node_id ( c. id ) , kind : ct_kind } )
2046
2052
}
2047
2053
_ => self . lower_anon_const_to_const_arg ( c) ,
@@ -2365,8 +2371,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2365
2371
hir_id = self . next_id ( ) ;
2366
2372
hir:: TyKind :: TraitObject (
2367
2373
arena_vec ! [ self ; principal] ,
2368
- self . elided_dyn_bound ( span) ,
2369
- TraitObjectSyntax :: None ,
2374
+ CovariantCopyTaggedPtr :: new (
2375
+ self . elided_dyn_bound ( span) ,
2376
+ TraitObjectSyntax :: None ,
2377
+ ) ,
2370
2378
)
2371
2379
}
2372
2380
_ => hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , path) ) ,
0 commit comments