]> git.lizzy.rs Git - rust.git/commitdiff
Rename `GenericArg::id` as `GenericArg::hir_id`.
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 29 Aug 2022 01:24:46 +0000 (11:24 +1000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 29 Aug 2022 04:16:49 +0000 (14:16 +1000)
Because `hir_id` is the standard name for methods that return a `HirId`
from a HIR node.

compiler/rustc_hir/src/hir.rs
compiler/rustc_typeck/src/astconv/generics.rs
compiler/rustc_typeck/src/astconv/mod.rs
compiler/rustc_typeck/src/collect/type_of.rs

index 69ba0aa84dc35adf48409b64b088377950865e7c..637709c764ccb6d534ac4958d5e022bbd2676ad0 100644 (file)
@@ -280,7 +280,7 @@ pub fn span(&self) -> Span {
         }
     }
 
-    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,
index 40aa27a29e957ce0955a64a020cce48281cd7ce0..074db108cff9ffd765096dc65006ff579c772b17 100644 (file)
@@ -648,7 +648,7 @@ pub(crate) fn prohibit_explicit_late_bound_lifetimes(
                 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();
index 5bb02bc246caf28bf5c05136bf6418a515747109..85dee26012981e12b37f87f7b71b526877c665f0 100644 (file)
@@ -398,7 +398,7 @@ fn provided_kind(
                     if has_default {
                         tcx.check_optional_stability(
                             param.def_id,
-                            Some(arg.id()),
+                            Some(arg.hir_id()),
                             arg.span(),
                             None,
                             AllowUnstable::No,
index f1dbe64f13abbb33e3cb4a323abb015be0288489..8df3d2ecaba010e53b905ade2d6b245419009e2f 100644 (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 {