Skip to content

Commit 0a52fbe

Browse files
committed
Rename GenericArg::id as GenericArg::hir_id.
Because `hir_id` is the standard name for methods that return a `HirId` from a HIR node.
1 parent ad7b4d5 commit 0a52fbe

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

compiler/rustc_hir/src/hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl GenericArg<'_> {
280280
}
281281
}
282282

283-
pub fn id(&self) -> HirId {
283+
pub fn hir_id(&self) -> HirId {
284284
match self {
285285
GenericArg::Lifetime(l) => l.hir_id,
286286
GenericArg::Type(t) => t.hir_id,

compiler/rustc_typeck/src/astconv/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
648648
multispan.push_span_label(span_late, note);
649649
tcx.struct_span_lint_hir(
650650
LATE_BOUND_LIFETIME_ARGUMENTS,
651-
args.args[0].id(),
651+
args.args[0].hir_id(),
652652
multispan,
653653
|lint| {
654654
lint.build(msg).emit();

compiler/rustc_typeck/src/astconv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
398398
if has_default {
399399
tcx.check_optional_stability(
400400
param.def_id,
401-
Some(arg.id()),
401+
Some(arg.hir_id()),
402402
arg.span(),
403403
None,
404404
AllowUnstable::No,

compiler/rustc_typeck/src/collect/type_of.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
7979
args.args
8080
.iter()
8181
.filter(|arg| arg.is_ty_or_const())
82-
.position(|arg| arg.id() == hir_id)
82+
.position(|arg| arg.hir_id() == hir_id)
8383
})
8484
.unwrap_or_else(|| {
8585
bug!("no arg matching AnonConst in segment");
@@ -112,7 +112,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
112112
args.args
113113
.iter()
114114
.filter(|arg| arg.is_ty_or_const())
115-
.position(|arg| arg.id() == hir_id)
115+
.position(|arg| arg.hir_id() == hir_id)
116116
})
117117
.unwrap_or_else(|| {
118118
bug!("no arg matching AnonConst in segment");
@@ -166,7 +166,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
166166
args.args
167167
.iter()
168168
.filter(|arg| arg.is_ty_or_const())
169-
.position(|arg| arg.id() == hir_id)
169+
.position(|arg| arg.hir_id() == hir_id)
170170
.map(|index| (index, seg)).or_else(|| args.bindings
171171
.iter()
172172
.filter_map(TypeBinding::opt_const)
@@ -229,7 +229,7 @@ fn get_path_containing_arg_in_pat<'hir>(
229229
.iter()
230230
.filter_map(|seg| seg.args)
231231
.flat_map(|args| args.args)
232-
.any(|arg| arg.id() == arg_id)
232+
.any(|arg| arg.hir_id() == arg_id)
233233
};
234234
let mut arg_path = None;
235235
pat.walk(|pat| match pat.kind {

0 commit comments

Comments
 (0)