Skip to content

Commit 700670f

Browse files
authored
Rollup merge of #91885 - LegionMammal978:less-inband-codegen_ssa, r=workingjubilee
Remove `in_band_lifetimes` from `rustc_codegen_ssa` See #91867 for more information. In `compiler/rustc_codegen_ssa/src/coverageinfo/map.rs`, there are several functions with an explicit `'a` lifetime but only a single `&'a self` parameter. These lifetimes should be redundant given lifetime elision, unless the existential `impl Iterator` has weird issues regarding that. Should the redundant lifetimes be removed?
2 parents 9ca0bd5 + eaf39cb commit 700670f

File tree

8 files changed

+16
-17
lines changed

8 files changed

+16
-17
lines changed

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn is_reachable_non_generic_provider_extern(tcx: TyCtxt<'_>, def_id: DefId) -> b
154154
tcx.reachable_non_generics(def_id.krate).contains_key(&def_id)
155155
}
156156

157-
fn exported_symbols_provider_local(
157+
fn exported_symbols_provider_local<'tcx>(
158158
tcx: TyCtxt<'tcx>,
159159
cnum: CrateNum,
160160
) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportLevel)] {

compiler/rustc_codegen_ssa/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ fn get_argc_argv<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
486486

487487
pub fn codegen_crate<B: ExtraBackendMethods>(
488488
backend: B,
489-
tcx: TyCtxt<'tcx>,
489+
tcx: TyCtxt<'_>,
490490
target_cpu: String,
491491
metadata: EncodedMetadata,
492492
need_metadata_module: bool,

compiler/rustc_codegen_ssa/src/coverageinfo/map.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ impl<'tcx> FunctionCoverage<'tcx> {
150150
/// Generate an array of CounterExpressions, and an iterator over all `Counter`s and their
151151
/// associated `Regions` (from which the LLVM-specific `CoverageMapGenerator` will create
152152
/// `CounterMappingRegion`s.
153-
pub fn get_expressions_and_counter_regions<'a>(
154-
&'a self,
155-
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &'a CodeRegion)>) {
153+
pub fn get_expressions_and_counter_regions(
154+
&self,
155+
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &CodeRegion)>) {
156156
assert!(
157157
self.source_hash != 0 || !self.is_used,
158158
"No counters provided the source_hash for used function: {:?}",
@@ -168,7 +168,7 @@ impl<'tcx> FunctionCoverage<'tcx> {
168168
(counter_expressions, counter_regions)
169169
}
170170

171-
fn counter_regions<'a>(&'a self) -> impl Iterator<Item = (Counter, &'a CodeRegion)> {
171+
fn counter_regions(&self) -> impl Iterator<Item = (Counter, &CodeRegion)> {
172172
self.counters.iter_enumerated().filter_map(|(index, entry)| {
173173
// Option::map() will return None to filter out missing counters. This may happen
174174
// if, for example, a MIR-instrumented counter is removed during an optimization.
@@ -177,8 +177,8 @@ impl<'tcx> FunctionCoverage<'tcx> {
177177
}
178178

179179
fn expressions_with_regions(
180-
&'a self,
181-
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &'a CodeRegion)>) {
180+
&self,
181+
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &CodeRegion)>) {
182182
let mut counter_expressions = Vec::with_capacity(self.expressions.len());
183183
let mut expression_regions = Vec::with_capacity(self.expressions.len());
184184
let mut new_indexes = IndexVec::from_elem_n(None, self.expressions.len());
@@ -336,7 +336,7 @@ impl<'tcx> FunctionCoverage<'tcx> {
336336
(counter_expressions, expression_regions.into_iter())
337337
}
338338

339-
fn unreachable_regions<'a>(&'a self) -> impl Iterator<Item = (Counter, &'a CodeRegion)> {
339+
fn unreachable_regions(&self) -> impl Iterator<Item = (Counter, &CodeRegion)> {
340340
self.unreachable_regions.iter().map(|region| (Counter::zero(), region))
341341
}
342342

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ fn push_debuginfo_type_name<'tcx>(
376376
// format (natvis) is able to understand enums and render the active variant correctly in the
377377
// debugger. For more information, look in `src/etc/natvis/intrinsic.natvis` and
378378
// `EnumMemberDescriptionFactor::create_member_descriptions`.
379-
fn msvc_enum_fallback(
379+
fn msvc_enum_fallback<'tcx>(
380380
tcx: TyCtxt<'tcx>,
381381
ty: Ty<'tcx>,
382382
def: &AdtDef,
@@ -496,7 +496,7 @@ pub fn compute_debuginfo_vtable_name<'tcx>(
496496
vtable_name
497497
}
498498

499-
pub fn push_item_name(tcx: TyCtxt<'tcx>, def_id: DefId, qualified: bool, output: &mut String) {
499+
pub fn push_item_name(tcx: TyCtxt<'_>, def_id: DefId, qualified: bool, output: &mut String) {
500500
let def_key = tcx.def_key(def_id);
501501
if qualified {
502502
if let Some(parent) = def_key.parent {
@@ -509,7 +509,7 @@ pub fn push_item_name(tcx: TyCtxt<'tcx>, def_id: DefId, qualified: bool, output:
509509
}
510510

511511
fn push_unqualified_item_name(
512-
tcx: TyCtxt<'tcx>,
512+
tcx: TyCtxt<'_>,
513513
def_id: DefId,
514514
disambiguated_data: DisambiguatedDefPathData,
515515
output: &mut String,

compiler/rustc_codegen_ssa/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![feature(bool_to_option)]
33
#![feature(box_patterns)]
44
#![feature(try_blocks)]
5-
#![feature(in_band_lifetimes)]
65
#![feature(let_else)]
76
#![feature(once_cell)]
87
#![feature(nll)]

compiler/rustc_codegen_ssa/src/mir/analyze.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
7373
locals: IndexVec<mir::Local, LocalKind>,
7474
}
7575

76-
impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
76+
impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
7777
fn assign(&mut self, local: mir::Local, location: Location) {
7878
let kind = &mut self.locals[local];
7979
match *kind {

compiler/rustc_codegen_ssa/src/mir/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct OperandRef<'tcx, V> {
4747
pub layout: TyAndLayout<'tcx>,
4848
}
4949

50-
impl<V: CodegenObject> fmt::Debug for OperandRef<'tcx, V> {
50+
impl<V: CodegenObject> fmt::Debug for OperandRef<'_, V> {
5151
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5252
write!(f, "OperandRef({:?} @ {:?})", self.val, self.layout)
5353
}

compiler/rustc_codegen_ssa/src/traits/type_.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub trait DerivedTypeMethods<'tcx>: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {
9797
}
9898
}
9999

100-
impl<T> DerivedTypeMethods<'tcx> for T where Self: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {}
100+
impl<'tcx, T> DerivedTypeMethods<'tcx> for T where Self: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {}
101101

102102
pub trait LayoutTypeMethods<'tcx>: Backend<'tcx> {
103103
fn backend_type(&self, layout: TyAndLayout<'tcx>) -> Self::Type;
@@ -135,4 +135,4 @@ pub trait ArgAbiMethods<'tcx>: HasCodegen<'tcx> {
135135

136136
pub trait TypeMethods<'tcx>: DerivedTypeMethods<'tcx> + LayoutTypeMethods<'tcx> {}
137137

138-
impl<T> TypeMethods<'tcx> for T where Self: DerivedTypeMethods<'tcx> + LayoutTypeMethods<'tcx> {}
138+
impl<'tcx, T> TypeMethods<'tcx> for T where Self: DerivedTypeMethods<'tcx> + LayoutTypeMethods<'tcx> {}

0 commit comments

Comments
 (0)