diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 69ba0aa84dc3..637709c764cc 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -280,7 +280,7 @@ impl GenericArg<'_> { } } - pub fn id(&self) -> HirId { + pub fn hir_id(&self) -> HirId { match self { GenericArg::Lifetime(l) => l.hir_id, GenericArg::Type(t) => t.hir_id, diff --git a/compiler/rustc_typeck/src/astconv/generics.rs b/compiler/rustc_typeck/src/astconv/generics.rs index 40aa27a29e95..074db108cff9 100644 --- a/compiler/rustc_typeck/src/astconv/generics.rs +++ b/compiler/rustc_typeck/src/astconv/generics.rs @@ -648,7 +648,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { multispan.push_span_label(span_late, note); tcx.struct_span_lint_hir( LATE_BOUND_LIFETIME_ARGUMENTS, - args.args[0].id(), + args.args[0].hir_id(), multispan, |lint| { lint.build(msg).emit(); diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs index 5bb02bc246ca..85dee2601298 100644 --- a/compiler/rustc_typeck/src/astconv/mod.rs +++ b/compiler/rustc_typeck/src/astconv/mod.rs @@ -398,7 +398,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { if has_default { tcx.check_optional_stability( param.def_id, - Some(arg.id()), + Some(arg.hir_id()), arg.span(), None, AllowUnstable::No, diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index f1dbe64f13ab..8df3d2ecaba0 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -79,7 +79,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option< args.args .iter() .filter(|arg| arg.is_ty_or_const()) - .position(|arg| arg.id() == hir_id) + .position(|arg| arg.hir_id() == hir_id) }) .unwrap_or_else(|| { bug!("no arg matching AnonConst in segment"); @@ -112,7 +112,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option< args.args .iter() .filter(|arg| arg.is_ty_or_const()) - .position(|arg| arg.id() == hir_id) + .position(|arg| arg.hir_id() == hir_id) }) .unwrap_or_else(|| { bug!("no arg matching AnonConst in segment"); @@ -166,7 +166,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option< args.args .iter() .filter(|arg| arg.is_ty_or_const()) - .position(|arg| arg.id() == hir_id) + .position(|arg| arg.hir_id() == hir_id) .map(|index| (index, seg)).or_else(|| args.bindings .iter() .filter_map(TypeBinding::opt_const) @@ -229,7 +229,7 @@ fn get_path_containing_arg_in_pat<'hir>( .iter() .filter_map(|seg| seg.args) .flat_map(|args| args.args) - .any(|arg| arg.id() == arg_id) + .any(|arg| arg.hir_id() == arg_id) }; let mut arg_path = None; pat.walk(|pat| match pat.kind {