Skip to content

Commit 443c816

Browse files
author
Lukas Markeffsky
committed
rename ast_* to hir_* in wfcheck
1 parent 189e784 commit 443c816

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -296,31 +296,31 @@ fn check_item<'tcx>(tcx: TyCtxt<'tcx>, item: &'tcx hir::Item<'tcx>) -> Result<()
296296
hir::ItemKind::Const(ty, ..) => {
297297
check_item_type(tcx, def_id, ty.span, UnsizedHandling::Forbid)
298298
}
299-
hir::ItemKind::Struct(_, ast_generics) => {
299+
hir::ItemKind::Struct(_, hir_generics) => {
300300
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);
302302
res
303303
}
304-
hir::ItemKind::Union(_, ast_generics) => {
304+
hir::ItemKind::Union(_, hir_generics) => {
305305
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);
307307
res
308308
}
309-
hir::ItemKind::Enum(_, ast_generics) => {
309+
hir::ItemKind::Enum(_, hir_generics) => {
310310
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);
312312
res
313313
}
314314
hir::ItemKind::Trait(..) => check_trait(tcx, item),
315315
hir::ItemKind::TraitAlias(..) => check_trait(tcx, item),
316316
// `ForeignItem`s are handled separately.
317317
hir::ItemKind::ForeignMod { .. } => Ok(()),
318-
hir::ItemKind::TyAlias(hir_ty, ast_generics) => {
318+
hir::ItemKind::TyAlias(hir_ty, hir_generics) => {
319319
if tcx.type_alias_is_lazy(item.owner_id) {
320320
// Bounds of lazy type aliases and of eager ones that contain opaque types are respected.
321321
// E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`.
322322
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);
324324
res
325325
} else {
326326
Ok(())
@@ -1277,24 +1277,24 @@ fn check_item_type(
12771277
})
12781278
}
12791279

1280-
#[instrument(level = "debug", skip(tcx, ast_self_ty, ast_trait_ref))]
1280+
#[instrument(level = "debug", skip(tcx, hir_self_ty, hir_trait_ref))]
12811281
fn check_impl<'tcx>(
12821282
tcx: TyCtxt<'tcx>,
12831283
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<'_>>,
12861286
) -> Result<(), ErrorGuaranteed> {
12871287
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) => {
12901290
// `#[rustc_reservation_impl]` impls are not real impls and
12911291
// therefore don't need to be WF (the trait's `Self: Trait` predicate
12921292
// won't hold).
12931293
let trait_ref = tcx.impl_trait_ref(item.owner_id).unwrap().instantiate_identity();
12941294
// Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
12951295
// other `Foo` impls are incoherent.
12961296
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;
12981298
let trait_ref = wfcx.normalize(
12991299
trait_span,
13001300
Some(WellFormedLoc::Ty(item.hir_id().expect_owner().def_id)),
@@ -1318,12 +1318,12 @@ fn check_impl<'tcx>(
13181318
if let Some(pred) = obligation.predicate.to_opt_poly_trait_pred()
13191319
&& pred.skip_binder().self_ty() == trait_ref.self_ty()
13201320
{
1321-
obligation.cause.span = ast_self_ty.span;
1321+
obligation.cause.span = hir_self_ty.span;
13221322
}
13231323
if let Some(pred) = obligation.predicate.to_opt_poly_projection_pred()
13241324
&& pred.skip_binder().self_ty() == trait_ref.self_ty()
13251325
{
1326-
obligation.cause.span = ast_self_ty.span;
1326+
obligation.cause.span = hir_self_ty.span;
13271327
}
13281328
}
13291329
debug!(?obligations);
@@ -1337,7 +1337,7 @@ fn check_impl<'tcx>(
13371337
self_ty,
13381338
);
13391339
wfcx.register_wf_obligation(
1340-
ast_self_ty.span,
1340+
hir_self_ty.span,
13411341
Some(WellFormedLoc::Ty(item.hir_id().expect_owner().def_id)),
13421342
self_ty.into(),
13431343
);

0 commit comments

Comments
 (0)