Skip to content

Commit

Permalink
Rollup merge of #91926 - SylvanB:remove_in_band_lifetimes_from_rustc_…
Browse files Browse the repository at this point in the history
…metadata, r=nagisa

Remove `in_band_lifetimes` from `rustc_metadata`

Another for #91867
  • Loading branch information
matthiaskrgr authored Dec 18, 2021
2 parents 1c42199 + 8679e17 commit 9e720a8
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/foreign_modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct Collector {
modules: Vec<ForeignModule>,
}

impl ItemLikeVisitor<'tcx> for Collector {
impl<'tcx> ItemLikeVisitor<'tcx> for Collector {
fn visit_item(&mut self, it: &'tcx hir::Item<'tcx>) {
let items = match it.kind {
hir::ItemKind::ForeignMod { items, .. } => items,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_metadata/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(crate_visibility_modifier)]
#![feature(drain_filter)]
#![feature(in_band_lifetimes)]
#![feature(let_else)]
#![feature(nll)]
#![feature(once_cell)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ impl<'a> CrateLocator<'a> {
}
}

fn get_metadata_section(
fn get_metadata_section<'p>(
target: &Target,
flavor: CrateFlavor,
filename: &'p Path,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_metadata/src/native_libs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct Collector<'tcx> {
libs: Vec<NativeLib>,
}

impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
impl<'tcx> ItemLikeVisitor<'tcx> for Collector<'tcx> {
fn visit_item(&mut self, it: &'tcx hir::Item<'tcx>) {
let (abi, foreign_mod_items) = match it.kind {
hir::ItemKind::ForeignMod { abi, items } => (abi, items),
Expand Down Expand Up @@ -223,7 +223,7 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
fn visit_foreign_item(&mut self, _it: &'tcx hir::ForeignItem<'tcx>) {}
}

impl Collector<'tcx> {
impl Collector<'_> {
fn register_native_lib(&mut self, span: Option<Span>, lib: NativeLib) {
if lib.name.as_ref().map_or(false, |&s| s == kw::Empty) {
match span {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_metadata/src/rmeta/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ where

implement_ty_decoder!(DecodeContext<'a, 'tcx>);

impl MetadataBlob {
impl<'tcx> MetadataBlob {
crate fn new(metadata_ref: MetadataRef) -> MetadataBlob {
MetadataBlob(Lrc::new(metadata_ref))
}
Expand Down Expand Up @@ -697,7 +697,7 @@ impl CrateRoot<'_> {
&self.triple
}

crate fn decode_crate_deps(
crate fn decode_crate_deps<'a>(
&self,
metadata: &'a MetadataBlob,
) -> impl ExactSizeIterator<Item = CrateDep> + Captures<'a> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl IntoArgs for (CrateNum, DefId) {
}
}

impl IntoArgs for ty::InstanceDef<'tcx> {
impl<'tcx> IntoArgs for ty::InstanceDef<'tcx> {
fn into_args(self) -> (DefId, DefId) {
(self.def_id(), self.def_id())
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ crate enum DefPathHashMapRef<'tcx> {
BorrowedFromTcx(&'tcx DefPathHashMap),
}

impl DefPathHashMapRef<'tcx> {
impl DefPathHashMapRef<'_> {
#[inline]
pub fn def_path_hash_to_def_index(&self, def_path_hash: &DefPathHash) -> DefIndex {
match *self {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ fn should_encode_generics(def_kind: DefKind) -> bool {
}
}

impl EncodeContext<'a, 'tcx> {
impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
fn encode_def_ids(&mut self) {
if self.is_proc_macro {
return;
Expand Down Expand Up @@ -1894,7 +1894,7 @@ impl EncodeContext<'a, 'tcx> {
}

// FIXME(eddyb) make metadata encoding walk over all definitions, instead of HIR.
impl Visitor<'tcx> for EncodeContext<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for EncodeContext<'a, 'tcx> {
type Map = Map<'tcx>;

fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
Expand Down Expand Up @@ -1927,7 +1927,7 @@ impl Visitor<'tcx> for EncodeContext<'a, 'tcx> {
}
}

impl EncodeContext<'a, 'tcx> {
impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
fn encode_fields(&mut self, adt_def: &ty::AdtDef) {
for (variant_index, variant) in adt_def.variants.iter_enumerated() {
for (field_index, _field) in variant.fields.iter().enumerate() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/rmeta/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ macro_rules! define_tables {
$($name: TableBuilder<$IDX, $T>),+
}

impl TableBuilders<'tcx> {
impl<'tcx> TableBuilders<'tcx> {
fn encode(&self, buf: &mut Encoder) -> LazyTables<'tcx> {
LazyTables {
$($name: self.$name.encode(buf)),+
Expand Down

0 comments on commit 9e720a8

Please sign in to comment.