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