From 7085b4e1179412bd015b35496f09386ead1c8d7a Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Mon, 13 Dec 2021 21:33:53 -0700
Subject: [PATCH] Remove `in_band_lifetimes` from `rustc_hir`
---
compiler/rustc_hir/src/hir.rs | 12 ++++++------
compiler/rustc_hir/src/intravisit.rs | 2 +-
compiler/rustc_hir/src/lib.rs | 1 -
compiler/rustc_hir/src/stable_hash_impls.rs | 4 ++--
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index fdf7a8102a0..1807bd3654f 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -522,7 +522,7 @@ pub struct GenericParam<'hir> {
pub kind: GenericParamKind<'hir>,
}
-impl GenericParam<'hir> {
+impl<'hir> GenericParam<'hir> {
pub fn bounds_span_for_suggestions(&self) -> Option {
self.bounds
.iter()
@@ -557,7 +557,7 @@ pub struct Generics<'hir> {
pub span: Span,
}
-impl Generics<'hir> {
+impl<'hir> Generics<'hir> {
pub const fn empty() -> Generics<'hir> {
Generics {
params: &[],
@@ -622,7 +622,7 @@ pub enum WherePredicate<'hir> {
EqPredicate(WhereEqPredicate<'hir>),
}
-impl WherePredicate<'_> {
+impl<'hir> WherePredicate<'hir> {
pub fn span(&self) -> Span {
match self {
WherePredicate::BoundPredicate(p) => p.span,
@@ -644,7 +644,7 @@ pub struct WhereBoundPredicate<'hir> {
pub bounds: GenericBounds<'hir>,
}
-impl WhereBoundPredicate<'hir> {
+impl<'hir> WhereBoundPredicate<'hir> {
/// Returns `true` if `param_def_id` matches the `bounded_ty` of this predicate.
pub fn is_param_bound(&self, param_def_id: DefId) -> bool {
let path = match self.bounded_ty.kind {
@@ -1236,7 +1236,7 @@ pub struct Body<'hir> {
pub generator_kind: Option,
}
-impl Body<'hir> {
+impl<'hir> Body<'hir> {
pub fn id(&self) -> BodyId {
BodyId { hir_id: self.value.hir_id }
}
@@ -2623,7 +2623,7 @@ pub enum VariantData<'hir> {
Unit(HirId),
}
-impl VariantData<'hir> {
+impl<'hir> VariantData<'hir> {
/// Return the fields of this variant.
pub fn fields(&self) -> &'hir [FieldDef<'hir>] {
match *self {
diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs
index 21f89104c4b..a2f1db3579a 100644
--- a/compiler/rustc_hir/src/intravisit.rs
+++ b/compiler/rustc_hir/src/intravisit.rs
@@ -139,7 +139,7 @@ pub trait Map<'hir> {
}
// Used when no map is actually available, forcing manual implementation of nested visitors.
-impl Map<'hir> for ! {
+impl<'hir> Map<'hir> for ! {
fn find(&self, _: HirId) -> Option> {
unreachable!()
}
diff --git a/compiler/rustc_hir/src/lib.rs b/compiler/rustc_hir/src/lib.rs
index 93224d388c0..1df9b5f9c78 100644
--- a/compiler/rustc_hir/src/lib.rs
+++ b/compiler/rustc_hir/src/lib.rs
@@ -4,7 +4,6 @@
#![feature(const_btree_new)]
#![feature(crate_visibility_modifier)]
-#![feature(in_band_lifetimes)]
#![feature(once_cell)]
#![feature(min_specialization)]
#![feature(never_type)]
diff --git a/compiler/rustc_hir/src/stable_hash_impls.rs b/compiler/rustc_hir/src/stable_hash_impls.rs
index 6e7b765a0c4..c8d729a999e 100644
--- a/compiler/rustc_hir/src/stable_hash_impls.rs
+++ b/compiler/rustc_hir/src/stable_hash_impls.rs
@@ -211,7 +211,7 @@ fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
}
}
-impl HashStable for OwnerNodes<'tcx> {
+impl<'tcx, HirCtx: crate::HashStableContext> HashStable for OwnerNodes<'tcx> {
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
// We ignore the `nodes` and `bodies` fields since these refer to information included in
// `hash` which is hashed in the collector and used for the crate hash.
@@ -221,7 +221,7 @@ fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
}
}
-impl HashStable for AttributeMap<'tcx> {
+impl<'tcx, HirCtx: crate::HashStableContext> HashStable for AttributeMap<'tcx> {
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
// We ignore the `map` since it refers to information included in `hash` which is hashed in
// the collector and used for the crate hash.