diff --git a/compiler/rustc_metadata/src/foreign_modules.rs b/compiler/rustc_metadata/src/foreign_modules.rs index 5b42f48a7d466..c70a691452018 100644 --- a/compiler/rustc_metadata/src/foreign_modules.rs +++ b/compiler/rustc_metadata/src/foreign_modules.rs @@ -13,7 +13,7 @@ struct Collector { modules: Vec, } -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, diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 0bf6c266b80e0..918c3b9daf107 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -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)] diff --git a/compiler/rustc_metadata/src/locator.rs b/compiler/rustc_metadata/src/locator.rs index e2fd8056f1a7c..2893ceb5bf543 100644 --- a/compiler/rustc_metadata/src/locator.rs +++ b/compiler/rustc_metadata/src/locator.rs @@ -734,7 +734,7 @@ impl<'a> CrateLocator<'a> { } } -fn get_metadata_section( +fn get_metadata_section<'p>( target: &Target, flavor: CrateFlavor, filename: &'p Path, diff --git a/compiler/rustc_metadata/src/native_libs.rs b/compiler/rustc_metadata/src/native_libs.rs index 9adf9406f09b4..808151089df85 100644 --- a/compiler/rustc_metadata/src/native_libs.rs +++ b/compiler/rustc_metadata/src/native_libs.rs @@ -31,7 +31,7 @@ struct Collector<'tcx> { libs: Vec, } -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), @@ -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, lib: NativeLib) { if lib.name.as_ref().map_or(false, |&s| s == kw::Empty) { match span { diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index b2c7818a54218..09c6cb010b04d 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -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)) } @@ -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 + Captures<'a> { diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index eeb0a77adc0ad..5ba7efc37f8bd 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -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()) } diff --git a/compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs b/compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs index d6435bb649d6d..054431169a26c 100644 --- a/compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs +++ b/compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs @@ -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 { diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 7500df896e971..a6828e103dc5f 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -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; @@ -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 { @@ -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() { diff --git a/compiler/rustc_metadata/src/rmeta/mod.rs b/compiler/rustc_metadata/src/rmeta/mod.rs index a65b5dade3e56..5ce239ac70426 100644 --- a/compiler/rustc_metadata/src/rmeta/mod.rs +++ b/compiler/rustc_metadata/src/rmeta/mod.rs @@ -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)),+