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:
parent
ad7b4d5d22
commit
0a52fbe536
4 changed files with 7 additions and 7 deletions
|
@ -280,7 +280,7 @@ impl GenericArg<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn id(&self) -> HirId {
|
pub fn hir_id(&self) -> HirId {
|
||||||
match self {
|
match self {
|
||||||
GenericArg::Lifetime(l) => l.hir_id,
|
GenericArg::Lifetime(l) => l.hir_id,
|
||||||
GenericArg::Type(t) => t.hir_id,
|
GenericArg::Type(t) => t.hir_id,
|
||||||
|
|
|
@ -648,7 +648,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
multispan.push_span_label(span_late, note);
|
multispan.push_span_label(span_late, note);
|
||||||
tcx.struct_span_lint_hir(
|
tcx.struct_span_lint_hir(
|
||||||
LATE_BOUND_LIFETIME_ARGUMENTS,
|
LATE_BOUND_LIFETIME_ARGUMENTS,
|
||||||
args.args[0].id(),
|
args.args[0].hir_id(),
|
||||||
multispan,
|
multispan,
|
||||||
|lint| {
|
|lint| {
|
||||||
lint.build(msg).emit();
|
lint.build(msg).emit();
|
||||||
|
|
|
@ -398,7 +398,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
if has_default {
|
if has_default {
|
||||||
tcx.check_optional_stability(
|
tcx.check_optional_stability(
|
||||||
param.def_id,
|
param.def_id,
|
||||||
Some(arg.id()),
|
Some(arg.hir_id()),
|
||||||
arg.span(),
|
arg.span(),
|
||||||
None,
|
None,
|
||||||
AllowUnstable::No,
|
AllowUnstable::No,
|
||||||
|
|
|
@ -79,7 +79,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
|
||||||
args.args
|
args.args
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|arg| arg.is_ty_or_const())
|
.filter(|arg| arg.is_ty_or_const())
|
||||||
.position(|arg| arg.id() == hir_id)
|
.position(|arg| arg.hir_id() == hir_id)
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
bug!("no arg matching AnonConst in segment");
|
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
|
args.args
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|arg| arg.is_ty_or_const())
|
.filter(|arg| arg.is_ty_or_const())
|
||||||
.position(|arg| arg.id() == hir_id)
|
.position(|arg| arg.hir_id() == hir_id)
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
bug!("no arg matching AnonConst in segment");
|
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
|
args.args
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|arg| arg.is_ty_or_const())
|
.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
|
.map(|index| (index, seg)).or_else(|| args.bindings
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(TypeBinding::opt_const)
|
.filter_map(TypeBinding::opt_const)
|
||||||
|
@ -229,7 +229,7 @@ fn get_path_containing_arg_in_pat<'hir>(
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|seg| seg.args)
|
.filter_map(|seg| seg.args)
|
||||||
.flat_map(|args| args.args)
|
.flat_map(|args| args.args)
|
||||||
.any(|arg| arg.id() == arg_id)
|
.any(|arg| arg.hir_id() == arg_id)
|
||||||
};
|
};
|
||||||
let mut arg_path = None;
|
let mut arg_path = None;
|
||||||
pat.walk(|pat| match pat.kind {
|
pat.walk(|pat| match pat.kind {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue