diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-29 11:24:46 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-29 14:16:49 +1000 |
| commit | 0a52fbe5366b98480dd9653ac0c0b4afaf6d6ebd (patch) | |
| tree | 7d7d3b3bbf30263751dd337bed0af4caedea5c26 | |
| parent | ad7b4d5d22b8d2b67225ab717800556d5139c74d (diff) | |
| download | rust-0a52fbe5366b98480dd9653ac0c0b4afaf6d6ebd.tar.gz rust-0a52fbe5366b98480dd9653ac0c0b4afaf6d6ebd.zip | |
Rename `GenericArg::id` as `GenericArg::hir_id`.
Because `hir_id` is the standard name for methods that return a `HirId` from a HIR node.
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/astconv/generics.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/astconv/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/collect/type_of.rs | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 69ba0aa84dc..637709c764c 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 40aa27a29e9..074db108cff 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 5bb02bc246c..85dee260129 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 f1dbe64f13a..8df3d2ecaba 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 { |
