Rename GenericArg::id as GenericArg::hir_id.

Because `hir_id` is the standard name for methods that return a `HirId`
from a HIR node.
This commit is contained in:
Nicholas Nethercote 2022-08-29 11:24:46 +10:00
parent ad7b4d5d22
commit 0a52fbe536
4 changed files with 7 additions and 7 deletions

View File

@ -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,

View File

@ -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();

View File

@ -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,

View File

@ -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 {