Skip to content

Commit da917cb

Browse files
authored
Unrolled build for rust-lang#129689
Rollup merge of rust-lang#129689 - compiler-errors:impl-lifetime, r=michaelwoerister Move `'tcx` lifetime off of impl and onto methods for `CrateMetadataRef` Unconstrained type and const variables are not allowed, but unconstrained lifetimes are. This is not very good style, though, and it leads to unnecessary captures of a lifetime in edition 2024 (not that it matters, but it does trigger the edition migration lint).
2 parents acb4e8b + 19296ca commit da917cb

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

+18-14
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ impl CrateRoot {
962962
}
963963
}
964964

965-
impl<'a, 'tcx> CrateMetadataRef<'a> {
965+
impl<'a> CrateMetadataRef<'a> {
966966
fn missing(self, descr: &str, id: DefIndex) -> ! {
967967
bug!("missing `{descr}` for {:?}", self.local_def_id(id))
968968
}
@@ -1036,7 +1036,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10361036
.decode((self, sess))
10371037
}
10381038

1039-
fn load_proc_macro(self, id: DefIndex, tcx: TyCtxt<'tcx>) -> SyntaxExtension {
1039+
fn load_proc_macro<'tcx>(self, id: DefIndex, tcx: TyCtxt<'tcx>) -> SyntaxExtension {
10401040
let (name, kind, helper_attrs) = match *self.raw_proc_macro(id) {
10411041
ProcMacro::CustomDerive { trait_name, attributes, client } => {
10421042
let helper_attrs =
@@ -1070,7 +1070,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10701070
)
10711071
}
10721072

1073-
fn get_explicit_item_bounds(
1073+
fn get_explicit_item_bounds<'tcx>(
10741074
self,
10751075
index: DefIndex,
10761076
tcx: TyCtxt<'tcx>,
@@ -1084,7 +1084,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10841084
ty::EarlyBinder::bind(&*output)
10851085
}
10861086

1087-
fn get_explicit_item_super_predicates(
1087+
fn get_explicit_item_super_predicates<'tcx>(
10881088
self,
10891089
index: DefIndex,
10901090
tcx: TyCtxt<'tcx>,
@@ -1141,7 +1141,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11411141
)
11421142
}
11431143

1144-
fn get_adt_def(self, item_id: DefIndex, tcx: TyCtxt<'tcx>) -> ty::AdtDef<'tcx> {
1144+
fn get_adt_def<'tcx>(self, item_id: DefIndex, tcx: TyCtxt<'tcx>) -> ty::AdtDef<'tcx> {
11451145
let kind = self.def_kind(item_id);
11461146
let did = self.local_def_id(item_id);
11471147

@@ -1225,12 +1225,12 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
12251225
/// Iterates over the stability implications in the given crate (when a `#[unstable]` attribute
12261226
/// has an `implied_by` meta item, then the mapping from the implied feature to the actual
12271227
/// feature is a stability implication).
1228-
fn get_stability_implications(self, tcx: TyCtxt<'tcx>) -> &'tcx [(Symbol, Symbol)] {
1228+
fn get_stability_implications<'tcx>(self, tcx: TyCtxt<'tcx>) -> &'tcx [(Symbol, Symbol)] {
12291229
tcx.arena.alloc_from_iter(self.root.stability_implications.decode(self))
12301230
}
12311231

12321232
/// Iterates over the lang items in the given crate.
1233-
fn get_lang_items(self, tcx: TyCtxt<'tcx>) -> &'tcx [(DefId, LangItem)] {
1233+
fn get_lang_items<'tcx>(self, tcx: TyCtxt<'tcx>) -> &'tcx [(DefId, LangItem)] {
12341234
tcx.arena.alloc_from_iter(
12351235
self.root
12361236
.lang_items
@@ -1239,7 +1239,11 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
12391239
)
12401240
}
12411241

1242-
fn get_stripped_cfg_items(self, cnum: CrateNum, tcx: TyCtxt<'tcx>) -> &'tcx [StrippedCfgItem] {
1242+
fn get_stripped_cfg_items<'tcx>(
1243+
self,
1244+
cnum: CrateNum,
1245+
tcx: TyCtxt<'tcx>,
1246+
) -> &'tcx [StrippedCfgItem] {
12431247
let item_names = self
12441248
.root
12451249
.stripped_cfg_items
@@ -1412,7 +1416,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14121416
.decode((self, sess))
14131417
}
14141418

1415-
fn get_inherent_implementations_for_type(
1419+
fn get_inherent_implementations_for_type<'tcx>(
14161420
self,
14171421
tcx: TyCtxt<'tcx>,
14181422
id: DefIndex,
@@ -1439,15 +1443,15 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14391443
})
14401444
}
14411445

1442-
fn get_incoherent_impls(self, tcx: TyCtxt<'tcx>, simp: SimplifiedType) -> &'tcx [DefId] {
1446+
fn get_incoherent_impls<'tcx>(self, tcx: TyCtxt<'tcx>, simp: SimplifiedType) -> &'tcx [DefId] {
14431447
if let Some(impls) = self.cdata.incoherent_impls.get(&simp) {
14441448
tcx.arena.alloc_from_iter(impls.decode(self).map(|idx| self.local_def_id(idx)))
14451449
} else {
14461450
&[]
14471451
}
14481452
}
14491453

1450-
fn get_implementations_of_trait(
1454+
fn get_implementations_of_trait<'tcx>(
14511455
self,
14521456
tcx: TyCtxt<'tcx>,
14531457
trait_def_id: DefId,
@@ -1491,7 +1495,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14911495
self.root.foreign_modules.decode((self, sess))
14921496
}
14931497

1494-
fn get_dylib_dependency_formats(
1498+
fn get_dylib_dependency_formats<'tcx>(
14951499
self,
14961500
tcx: TyCtxt<'tcx>,
14971501
) -> &'tcx [(CrateNum, LinkagePreference)] {
@@ -1503,11 +1507,11 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
15031507
)
15041508
}
15051509

1506-
fn get_missing_lang_items(self, tcx: TyCtxt<'tcx>) -> &'tcx [LangItem] {
1510+
fn get_missing_lang_items<'tcx>(self, tcx: TyCtxt<'tcx>) -> &'tcx [LangItem] {
15071511
tcx.arena.alloc_from_iter(self.root.lang_items_missing.decode(self))
15081512
}
15091513

1510-
fn exported_symbols(
1514+
fn exported_symbols<'tcx>(
15111515
self,
15121516
tcx: TyCtxt<'tcx>,
15131517
) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportInfo)] {

0 commit comments

Comments
 (0)