@@ -296,31 +296,31 @@ fn check_item<'tcx>(tcx: TyCtxt<'tcx>, item: &'tcx hir::Item<'tcx>) -> Result<()
296
296
hir:: ItemKind :: Const ( ty, ..) => {
297
297
check_item_type ( tcx, def_id, ty. span , UnsizedHandling :: Forbid )
298
298
}
299
- hir:: ItemKind :: Struct ( _, ast_generics ) => {
299
+ hir:: ItemKind :: Struct ( _, hir_generics ) => {
300
300
let res = check_type_defn ( tcx, item, false ) ;
301
- check_variances_for_type_defn ( tcx, item, ast_generics ) ;
301
+ check_variances_for_type_defn ( tcx, item, hir_generics ) ;
302
302
res
303
303
}
304
- hir:: ItemKind :: Union ( _, ast_generics ) => {
304
+ hir:: ItemKind :: Union ( _, hir_generics ) => {
305
305
let res = check_type_defn ( tcx, item, true ) ;
306
- check_variances_for_type_defn ( tcx, item, ast_generics ) ;
306
+ check_variances_for_type_defn ( tcx, item, hir_generics ) ;
307
307
res
308
308
}
309
- hir:: ItemKind :: Enum ( _, ast_generics ) => {
309
+ hir:: ItemKind :: Enum ( _, hir_generics ) => {
310
310
let res = check_type_defn ( tcx, item, true ) ;
311
- check_variances_for_type_defn ( tcx, item, ast_generics ) ;
311
+ check_variances_for_type_defn ( tcx, item, hir_generics ) ;
312
312
res
313
313
}
314
314
hir:: ItemKind :: Trait ( ..) => check_trait ( tcx, item) ,
315
315
hir:: ItemKind :: TraitAlias ( ..) => check_trait ( tcx, item) ,
316
316
// `ForeignItem`s are handled separately.
317
317
hir:: ItemKind :: ForeignMod { .. } => Ok ( ( ) ) ,
318
- hir:: ItemKind :: TyAlias ( hir_ty, ast_generics ) => {
318
+ hir:: ItemKind :: TyAlias ( hir_ty, hir_generics ) => {
319
319
if tcx. type_alias_is_lazy ( item. owner_id ) {
320
320
// Bounds of lazy type aliases and of eager ones that contain opaque types are respected.
321
321
// E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`.
322
322
let res = check_item_type ( tcx, def_id, hir_ty. span , UnsizedHandling :: Allow ) ;
323
- check_variances_for_type_defn ( tcx, item, ast_generics ) ;
323
+ check_variances_for_type_defn ( tcx, item, hir_generics ) ;
324
324
res
325
325
} else {
326
326
Ok ( ( ) )
@@ -1277,24 +1277,24 @@ fn check_item_type(
1277
1277
} )
1278
1278
}
1279
1279
1280
- #[ instrument( level = "debug" , skip( tcx, ast_self_ty , ast_trait_ref ) ) ]
1280
+ #[ instrument( level = "debug" , skip( tcx, hir_self_ty , hir_trait_ref ) ) ]
1281
1281
fn check_impl < ' tcx > (
1282
1282
tcx : TyCtxt < ' tcx > ,
1283
1283
item : & ' tcx hir:: Item < ' tcx > ,
1284
- ast_self_ty : & hir:: Ty < ' _ > ,
1285
- ast_trait_ref : & Option < hir:: TraitRef < ' _ > > ,
1284
+ hir_self_ty : & hir:: Ty < ' _ > ,
1285
+ hir_trait_ref : & Option < hir:: TraitRef < ' _ > > ,
1286
1286
) -> Result < ( ) , ErrorGuaranteed > {
1287
1287
enter_wf_checking_ctxt ( tcx, item. span , item. owner_id . def_id , |wfcx| {
1288
- match ast_trait_ref {
1289
- Some ( ast_trait_ref ) => {
1288
+ match hir_trait_ref {
1289
+ Some ( hir_trait_ref ) => {
1290
1290
// `#[rustc_reservation_impl]` impls are not real impls and
1291
1291
// therefore don't need to be WF (the trait's `Self: Trait` predicate
1292
1292
// won't hold).
1293
1293
let trait_ref = tcx. impl_trait_ref ( item. owner_id ) . unwrap ( ) . instantiate_identity ( ) ;
1294
1294
// Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
1295
1295
// other `Foo` impls are incoherent.
1296
1296
tcx. ensure ( ) . coherent_trait ( trait_ref. def_id ) ?;
1297
- let trait_span = ast_trait_ref . path . span ;
1297
+ let trait_span = hir_trait_ref . path . span ;
1298
1298
let trait_ref = wfcx. normalize (
1299
1299
trait_span,
1300
1300
Some ( WellFormedLoc :: Ty ( item. hir_id ( ) . expect_owner ( ) . def_id ) ) ,
@@ -1318,12 +1318,12 @@ fn check_impl<'tcx>(
1318
1318
if let Some ( pred) = obligation. predicate . to_opt_poly_trait_pred ( )
1319
1319
&& pred. skip_binder ( ) . self_ty ( ) == trait_ref. self_ty ( )
1320
1320
{
1321
- obligation. cause . span = ast_self_ty . span ;
1321
+ obligation. cause . span = hir_self_ty . span ;
1322
1322
}
1323
1323
if let Some ( pred) = obligation. predicate . to_opt_poly_projection_pred ( )
1324
1324
&& pred. skip_binder ( ) . self_ty ( ) == trait_ref. self_ty ( )
1325
1325
{
1326
- obligation. cause . span = ast_self_ty . span ;
1326
+ obligation. cause . span = hir_self_ty . span ;
1327
1327
}
1328
1328
}
1329
1329
debug ! ( ?obligations) ;
@@ -1337,7 +1337,7 @@ fn check_impl<'tcx>(
1337
1337
self_ty,
1338
1338
) ;
1339
1339
wfcx. register_wf_obligation (
1340
- ast_self_ty . span ,
1340
+ hir_self_ty . span ,
1341
1341
Some ( WellFormedLoc :: Ty ( item. hir_id ( ) . expect_owner ( ) . def_id ) ) ,
1342
1342
self_ty. into ( ) ,
1343
1343
) ;
0 commit comments