Skip to content

Commit eceed7c

Browse files
Rollup merge of #155549 - nnethercote:rm-lifetimes, r=JohnTitor
Remove some unnecessary lifetimes. We have a number of structs with more lifetimes than necessary. This commit removes them. LLM disclosure: I asked Claude Code to check for unnecessary lifetimes in all types with three or more lifetimes, and it produced a list of candidates (half of which were invalid). I did the modifications for the valid cases myself, and found a couple more cases along the way. r? @JohnTitor
2 parents 356fdf0 + 5e00b8e commit eceed7c

8 files changed

Lines changed: 64 additions & 66 deletions

File tree

compiler/rustc_borrowck/src/polonius/dump.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl LocalizedConstraintGraphVisitor for LocalizedOutlivesConstraintCollector {
107107
/// - a mermaid graph of the NLL regions and the constraints between them
108108
/// - a mermaid graph of the NLL SCCs and the constraints between them
109109
fn emit_polonius_dump<'tcx>(
110-
dumper: &MirDumper<'_, '_, 'tcx>,
110+
dumper: &MirDumper<'_, 'tcx>,
111111
body: &Body<'tcx>,
112112
regioncx: &RegionInferenceContext<'tcx>,
113113
borrow_set: &BorrowSet<'tcx>,
@@ -186,7 +186,7 @@ fn emit_polonius_dump<'tcx>(
186186

187187
/// Emits the polonius MIR, as escaped HTML.
188188
fn emit_html_mir<'tcx>(
189-
dumper: &MirDumper<'_, '_, 'tcx>,
189+
dumper: &MirDumper<'_, 'tcx>,
190190
body: &Body<'tcx>,
191191
out: &mut dyn io::Write,
192192
) -> io::Result<()> {

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,14 +1901,14 @@ impl FnParam<'_> {
19011901
}
19021902
}
19031903

1904-
struct FnCallDiagCtxt<'a, 'b, 'tcx> {
1905-
arg_matching_ctxt: ArgMatchingCtxt<'a, 'b, 'tcx>,
1904+
struct FnCallDiagCtxt<'a, 'tcx> {
1905+
arg_matching_ctxt: ArgMatchingCtxt<'a, 'tcx>,
19061906
errors: Vec<Error<'tcx>>,
19071907
matched_inputs: IndexVec<ExpectedIdx, Option<ProvidedIdx>>,
19081908
}
19091909

1910-
impl<'a, 'b, 'tcx> Deref for FnCallDiagCtxt<'a, 'b, 'tcx> {
1911-
type Target = ArgMatchingCtxt<'a, 'b, 'tcx>;
1910+
impl<'a, 'tcx> Deref for FnCallDiagCtxt<'a, 'tcx> {
1911+
type Target = ArgMatchingCtxt<'a, 'tcx>;
19121912

19131913
fn deref(&self) -> &Self::Target {
19141914
&self.arg_matching_ctxt
@@ -1921,9 +1921,9 @@ enum ArgumentsFormatting {
19211921
Multiline { fallback_indent: String, brace_indent: String },
19221922
}
19231923

1924-
impl<'a, 'b, 'tcx> FnCallDiagCtxt<'a, 'b, 'tcx> {
1924+
impl<'a, 'tcx> FnCallDiagCtxt<'a, 'tcx> {
19251925
fn new(
1926-
arg: &'a FnCtxt<'b, 'tcx>,
1926+
arg: &'a FnCtxt<'a, 'tcx>,
19271927
compatibility_diagonal: IndexVec<ProvidedIdx, Compatibility<'tcx>>,
19281928
formal_and_expected_inputs: IndexVec<ExpectedIdx, (Ty<'tcx>, Ty<'tcx>)>,
19291929
provided_args: IndexVec<ProvidedIdx, &'tcx Expr<'tcx>>,
@@ -2618,7 +2618,7 @@ impl<'a, 'b, 'tcx> FnCallDiagCtxt<'a, 'b, 'tcx> {
26182618
(suggestions, labels, suggestion_text)
26192619
}
26202620

2621-
fn label_generic_mismatches(&self, err: &mut Diag<'b>) {
2621+
fn label_generic_mismatches(&self, err: &mut Diag<'a>) {
26222622
self.fn_ctxt.label_generic_mismatches(
26232623
err,
26242624
self.fn_def_id,
@@ -2778,22 +2778,22 @@ impl<'a, 'b, 'tcx> FnCallDiagCtxt<'a, 'b, 'tcx> {
27782778
}
27792779
}
27802780

2781-
struct ArgMatchingCtxt<'a, 'b, 'tcx> {
2782-
args_ctxt: ArgsCtxt<'a, 'b, 'tcx>,
2781+
struct ArgMatchingCtxt<'a, 'tcx> {
2782+
args_ctxt: ArgsCtxt<'a, 'tcx>,
27832783
provided_arg_tys: IndexVec<ProvidedIdx, (Ty<'tcx>, Span)>,
27842784
}
27852785

2786-
impl<'a, 'b, 'tcx> Deref for ArgMatchingCtxt<'a, 'b, 'tcx> {
2787-
type Target = ArgsCtxt<'a, 'b, 'tcx>;
2786+
impl<'a, 'tcx> Deref for ArgMatchingCtxt<'a, 'tcx> {
2787+
type Target = ArgsCtxt<'a, 'tcx>;
27882788

27892789
fn deref(&self) -> &Self::Target {
27902790
&self.args_ctxt
27912791
}
27922792
}
27932793

2794-
impl<'a, 'b, 'tcx> ArgMatchingCtxt<'a, 'b, 'tcx> {
2794+
impl<'a, 'tcx> ArgMatchingCtxt<'a, 'tcx> {
27952795
fn new(
2796-
arg: &'a FnCtxt<'b, 'tcx>,
2796+
arg: &'a FnCtxt<'a, 'tcx>,
27972797
compatibility_diagonal: IndexVec<ProvidedIdx, Compatibility<'tcx>>,
27982798
formal_and_expected_inputs: IndexVec<ExpectedIdx, (Ty<'tcx>, Ty<'tcx>)>,
27992799
provided_args: IndexVec<ProvidedIdx, &'tcx Expr<'tcx>>,
@@ -2924,23 +2924,23 @@ impl<'a, 'b, 'tcx> ArgMatchingCtxt<'a, 'b, 'tcx> {
29242924
}
29252925
}
29262926

2927-
struct ArgsCtxt<'a, 'b, 'tcx> {
2928-
call_ctxt: CallCtxt<'a, 'b, 'tcx>,
2927+
struct ArgsCtxt<'a, 'tcx> {
2928+
call_ctxt: CallCtxt<'a, 'tcx>,
29292929
call_metadata: CallMetadata,
29302930
args_span: Span,
29312931
}
29322932

2933-
impl<'a, 'b, 'tcx> Deref for ArgsCtxt<'a, 'b, 'tcx> {
2934-
type Target = CallCtxt<'a, 'b, 'tcx>;
2933+
impl<'a, 'tcx> Deref for ArgsCtxt<'a, 'tcx> {
2934+
type Target = CallCtxt<'a, 'tcx>;
29352935

29362936
fn deref(&self) -> &Self::Target {
29372937
&self.call_ctxt
29382938
}
29392939
}
29402940

2941-
impl<'a, 'b, 'tcx> ArgsCtxt<'a, 'b, 'tcx> {
2941+
impl<'a, 'tcx> ArgsCtxt<'a, 'tcx> {
29422942
fn new(
2943-
arg: &'a FnCtxt<'b, 'tcx>,
2943+
arg: &'a FnCtxt<'a, 'tcx>,
29442944
compatibility_diagonal: IndexVec<ProvidedIdx, Compatibility<'tcx>>,
29452945
formal_and_expected_inputs: IndexVec<ExpectedIdx, (Ty<'tcx>, Ty<'tcx>)>,
29462946
provided_args: IndexVec<ProvidedIdx, &'tcx Expr<'tcx>>,
@@ -2951,7 +2951,7 @@ impl<'a, 'b, 'tcx> ArgsCtxt<'a, 'b, 'tcx> {
29512951
call_expr: &'tcx Expr<'tcx>,
29522952
tuple_arguments: TupleArgumentsFlag,
29532953
) -> Self {
2954-
let call_ctxt: CallCtxt<'_, '_, '_> = CallCtxt::new(
2954+
let call_ctxt: CallCtxt<'_, '_> = CallCtxt::new(
29552955
arg,
29562956
compatibility_diagonal,
29572957
formal_and_expected_inputs,
@@ -3058,8 +3058,8 @@ struct CallMetadata {
30583058
is_method: bool,
30593059
}
30603060

3061-
struct CallCtxt<'a, 'b, 'tcx> {
3062-
fn_ctxt: &'a FnCtxt<'b, 'tcx>,
3061+
struct CallCtxt<'a, 'tcx> {
3062+
fn_ctxt: &'a FnCtxt<'a, 'tcx>,
30633063
compatibility_diagonal: IndexVec<ProvidedIdx, Compatibility<'tcx>>,
30643064
formal_and_expected_inputs: IndexVec<ExpectedIdx, (Ty<'tcx>, Ty<'tcx>)>,
30653065
provided_args: IndexVec<ProvidedIdx, &'tcx hir::Expr<'tcx>>,
@@ -3073,17 +3073,17 @@ struct CallCtxt<'a, 'b, 'tcx> {
30733073
callee_ty: Option<Ty<'tcx>>,
30743074
}
30753075

3076-
impl<'a, 'b, 'tcx> Deref for CallCtxt<'a, 'b, 'tcx> {
3077-
type Target = &'a FnCtxt<'b, 'tcx>;
3076+
impl<'a, 'tcx> Deref for CallCtxt<'a, 'tcx> {
3077+
type Target = &'a FnCtxt<'a, 'tcx>;
30783078

30793079
fn deref(&self) -> &Self::Target {
30803080
&self.fn_ctxt
30813081
}
30823082
}
30833083

3084-
impl<'a, 'b, 'tcx> CallCtxt<'a, 'b, 'tcx> {
3084+
impl<'a, 'tcx> CallCtxt<'a, 'tcx> {
30853085
fn new(
3086-
fn_ctxt: &'a FnCtxt<'b, 'tcx>,
3086+
fn_ctxt: &'a FnCtxt<'a, 'tcx>,
30873087
compatibility_diagonal: IndexVec<ProvidedIdx, Compatibility<'tcx>>,
30883088
formal_and_expected_inputs: IndexVec<ExpectedIdx, (Ty<'tcx>, Ty<'tcx>)>,
30893089
provided_args: IndexVec<ProvidedIdx, &'tcx hir::Expr<'tcx>>,
@@ -3093,7 +3093,7 @@ impl<'a, 'b, 'tcx> CallCtxt<'a, 'b, 'tcx> {
30933093
call_span: Span,
30943094
call_expr: &'tcx hir::Expr<'tcx>,
30953095
tuple_arguments: TupleArgumentsFlag,
3096-
) -> CallCtxt<'a, 'b, 'tcx> {
3096+
) -> CallCtxt<'a, 'tcx> {
30973097
let callee_expr = match &call_expr.peel_blocks().kind {
30983098
hir::ExprKind::Call(callee, _) => Some(*callee),
30993099
hir::ExprKind::MethodCall(_, receiver, ..) => {

compiler/rustc_hir_typeck/src/method/prelude_edition_lints.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ use tracing::debug;
1616
use crate::FnCtxt;
1717
use crate::method::probe::{self, Pick};
1818

19-
struct AmbiguousTraitMethodCall<'a, 'b, 'tcx> {
19+
struct AmbiguousTraitMethodCall<'a, 'tcx> {
2020
segment_name: Symbol,
2121
self_expr_span: Span,
2222
pick: &'a Pick<'tcx>,
2323
tcx: TyCtxt<'tcx>,
24-
edition: &'b str,
24+
edition: &'static str,
2525
}
2626

27-
impl<'a, 'b, 'c, 'tcx> Diagnostic<'a, ()> for AmbiguousTraitMethodCall<'b, 'c, 'tcx> {
27+
impl<'a, 'b, 'tcx> Diagnostic<'a, ()> for AmbiguousTraitMethodCall<'b, 'tcx> {
2828
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> {
2929
let Self { segment_name, self_expr_span, pick, tcx, edition } = self;
3030
let mut lint = Diag::new(
@@ -80,20 +80,18 @@ impl<'a, 'b, 'c, 'tcx> Diagnostic<'a, ()> for AmbiguousTraitMethodCall<'b, 'c, '
8080
}
8181
}
8282

83-
struct AmbiguousTraitMethod<'a, 'b, 'tcx, 'pcx, 'fnctx> {
84-
segment: &'a hir::PathSegment<'pcx>,
83+
struct AmbiguousTraitMethod<'a, 'tcx, 'fnctx> {
84+
segment: &'a hir::PathSegment<'tcx>,
8585
call_expr: &'tcx hir::Expr<'tcx>,
8686
self_expr: &'tcx hir::Expr<'tcx>,
8787
pick: &'a Pick<'tcx>,
8888
args: &'tcx [hir::Expr<'tcx>],
89-
edition: &'b str,
89+
edition: &'static str,
9090
span: Span,
9191
this: &'a FnCtxt<'fnctx, 'tcx>,
9292
}
9393

94-
impl<'a, 'b, 'c, 'tcx, 'pcx, 'fnctx> Diagnostic<'a, ()>
95-
for AmbiguousTraitMethod<'b, 'c, 'tcx, 'pcx, 'fnctx>
96-
{
94+
impl<'a, 'c, 'tcx, 'fnctx> Diagnostic<'a, ()> for AmbiguousTraitMethod<'c, 'tcx, 'fnctx> {
9795
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> {
9896
let Self { segment, call_expr, self_expr, pick, args, edition, span, this } = self;
9997
let mut lint = Diag::new(
@@ -158,7 +156,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
158156
pub(super) fn lint_edition_dependent_dot_call(
159157
&self,
160158
self_ty: Ty<'tcx>,
161-
segment: &hir::PathSegment<'_>,
159+
segment: &hir::PathSegment<'tcx>,
162160
span: Span,
163161
call_expr: &'tcx hir::Expr<'tcx>,
164162
self_expr: &'tcx hir::Expr<'tcx>,

compiler/rustc_hir_typeck/src/upvar.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,15 +958,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
958958
capture_clause: hir::CaptureBy,
959959
span: Span,
960960
) {
961-
struct MigrationLint<'a, 'b, 'tcx> {
961+
struct MigrationLint<'a, 'tcx> {
962962
closure_def_id: LocalDefId,
963-
this: &'a FnCtxt<'b, 'tcx>,
963+
this: &'a FnCtxt<'a, 'tcx>,
964964
body_id: hir::BodyId,
965965
need_migrations: Vec<NeededMigration>,
966966
migration_message: String,
967967
}
968968

969-
impl<'a, 'b, 'c, 'tcx> Diagnostic<'a, ()> for MigrationLint<'b, 'c, 'tcx> {
969+
impl<'a, 'b, 'tcx> Diagnostic<'a, ()> for MigrationLint<'b, 'tcx> {
970970
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> {
971971
let Self { closure_def_id, this, body_id, need_migrations, migration_message } =
972972
self;
@@ -2084,8 +2084,8 @@ fn drop_location_span(tcx: TyCtxt<'_>, hir_id: HirId) -> Span {
20842084
tcx.sess.source_map().end_point(owner_span)
20852085
}
20862086

2087-
struct InferBorrowKind<'fcx, 'a, 'tcx> {
2088-
fcx: &'fcx FnCtxt<'a, 'tcx>,
2087+
struct InferBorrowKind<'a, 'tcx> {
2088+
fcx: &'a FnCtxt<'a, 'tcx>,
20892089
// The def-id of the closure whose kind and upvar accesses are being inferred.
20902090
closure_def_id: LocalDefId,
20912091

@@ -2119,7 +2119,7 @@ struct InferBorrowKind<'fcx, 'a, 'tcx> {
21192119
fake_reads: Vec<(Place<'tcx>, FakeReadCause, HirId)>,
21202120
}
21212121

2122-
impl<'fcx, 'a, 'tcx> euv::Delegate<'tcx> for InferBorrowKind<'fcx, 'a, 'tcx> {
2122+
impl<'a, 'tcx> euv::Delegate<'tcx> for InferBorrowKind<'a, 'tcx> {
21232123
#[instrument(skip(self), level = "debug")]
21242124
fn fake_read(
21252125
&mut self,

compiler/rustc_lint/src/default_could_be_derived.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ impl<'tcx> LateLintPass<'tcx> for DefaultCouldBeDerived {
156156
}
157157
}
158158

159-
struct WrongDefaultImpl<'a, 'hir, 'tcx> {
159+
struct WrongDefaultImpl<'a, 'tcx> {
160160
tcx: TyCtxt<'tcx>,
161161
type_def_id: DefId,
162-
orig_fields: FxHashMap<Symbol, &'a hir::FieldDef<'hir>>,
163-
fields: &'a [hir::ExprField<'hir>],
162+
orig_fields: FxHashMap<Symbol, &'a hir::FieldDef<'tcx>>,
163+
fields: &'a [hir::ExprField<'tcx>],
164164
impl_span: Span,
165165
}
166166

167-
impl<'a, 'b, 'hir, 'tcx> Diagnostic<'a, ()> for WrongDefaultImpl<'b, 'hir, 'tcx> {
167+
impl<'a, 'b, 'tcx> Diagnostic<'a, ()> for WrongDefaultImpl<'b, 'tcx> {
168168
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> {
169169
let Self { tcx, type_def_id, orig_fields, fields, impl_span } = self;
170170
let mut diag =

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ impl PrettyPrintMirOptions {
6161
/// Manages MIR dumping, which is MIR writing done to a file with a specific name. In particular,
6262
/// it makes it impossible to dump MIR to one of these files when it hasn't been requested from the
6363
/// command line. Layered on top of `MirWriter`, which does the actual writing.
64-
pub struct MirDumper<'dis, 'de, 'tcx> {
64+
pub struct MirDumper<'a, 'tcx> {
6565
show_pass_num: bool,
6666
pass_name: &'static str,
67-
disambiguator: &'dis dyn Display,
68-
writer: MirWriter<'de, 'tcx>,
67+
disambiguator: &'a dyn Display,
68+
writer: MirWriter<'a, 'tcx>,
6969
}
7070

71-
impl<'dis, 'de, 'tcx> MirDumper<'dis, 'de, 'tcx> {
71+
impl<'a, 'tcx> MirDumper<'a, 'tcx> {
7272
// If dumping should be performed (e.g. because it was requested on the
7373
// CLI), returns a `MirDumper` with default values for the following fields:
7474
// - `show_pass_num`: `false`
@@ -112,15 +112,15 @@ impl<'dis, 'de, 'tcx> MirDumper<'dis, 'de, 'tcx> {
112112
}
113113

114114
#[must_use]
115-
pub fn set_disambiguator(mut self, disambiguator: &'dis dyn Display) -> Self {
115+
pub fn set_disambiguator(mut self, disambiguator: &'a dyn Display) -> Self {
116116
self.disambiguator = disambiguator;
117117
self
118118
}
119119

120120
#[must_use]
121121
pub fn set_extra_data(
122122
mut self,
123-
extra_data: &'de dyn Fn(PassWhere, &mut dyn io::Write) -> io::Result<()>,
123+
extra_data: &'a dyn Fn(PassWhere, &mut dyn io::Write) -> io::Result<()>,
124124
) -> Self {
125125
self.writer.extra_data = extra_data;
126126
self
@@ -369,13 +369,13 @@ pub fn write_mir_pretty<'tcx>(
369369
}
370370

371371
/// Does the writing of MIR to output, e.g. a file.
372-
pub struct MirWriter<'de, 'tcx> {
372+
pub struct MirWriter<'a, 'tcx> {
373373
tcx: TyCtxt<'tcx>,
374-
extra_data: &'de dyn Fn(PassWhere, &mut dyn io::Write) -> io::Result<()>,
374+
extra_data: &'a dyn Fn(PassWhere, &mut dyn io::Write) -> io::Result<()>,
375375
options: PrettyPrintMirOptions,
376376
}
377377

378-
impl<'de, 'tcx> MirWriter<'de, 'tcx> {
378+
impl<'a, 'tcx> MirWriter<'a, 'tcx> {
379379
pub fn new(tcx: TyCtxt<'tcx>) -> Self {
380380
MirWriter { tcx, extra_data: &|_, _| Ok(()), options: PrettyPrintMirOptions::from_cli(tcx) }
381381
}
@@ -709,7 +709,7 @@ pub fn dump_mir_def_ids(tcx: TyCtxt<'_>, single: Option<DefId>) -> Vec<DefId> {
709709
///////////////////////////////////////////////////////////////////////////
710710
// Basic blocks and their parts (statements, terminators, ...)
711711

712-
impl<'de, 'tcx> MirWriter<'de, 'tcx> {
712+
impl<'a, 'tcx> MirWriter<'a, 'tcx> {
713713
/// Write out a human-readable textual representation for the given basic block.
714714
fn write_basic_block(
715715
&self,

compiler/rustc_mir_build/src/errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,14 +649,14 @@ pub(crate) enum UnusedUnsafeEnclosing {
649649
},
650650
}
651651

652-
pub(crate) struct NonExhaustivePatternsTypeNotEmpty<'p, 'tcx, 'm> {
653-
pub(crate) cx: &'m RustcPatCtxt<'p, 'tcx>,
652+
pub(crate) struct NonExhaustivePatternsTypeNotEmpty<'a, 'tcx> {
653+
pub(crate) cx: &'a RustcPatCtxt<'a, 'tcx>,
654654
pub(crate) scrut_span: Span,
655655
pub(crate) braces_span: Option<Span>,
656656
pub(crate) ty: Ty<'tcx>,
657657
}
658658

659-
impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for NonExhaustivePatternsTypeNotEmpty<'_, '_, '_> {
659+
impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for NonExhaustivePatternsTypeNotEmpty<'_, '_> {
660660
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
661661
let mut diag =
662662
Diag::new(dcx, level, msg!("non-exhaustive patterns: type `{$ty}` is non-empty"));

compiler/rustc_monomorphize/src/graph_checks/statics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ newtype_index! {
3737
// Adjacency-list graph for statics using `StaticNodeIdx` as node type.
3838
// We cannot use `DefId` as the node type directly because each node must be
3939
// represented by an index in the range `0..num_nodes`.
40-
struct StaticRefGraph<'a, 'b, 'tcx> {
40+
struct StaticRefGraph<'a, 'tcx> {
4141
// maps from `StaticNodeIdx` to `DefId` and vice versa
4242
statics: &'a FxIndexSet<DefId>,
4343
// contains for each `MonoItem` the `MonoItem`s it uses
44-
used_map: &'b UnordMap<MonoItem<'tcx>, Vec<MonoItem<'tcx>>>,
44+
used_map: &'a UnordMap<MonoItem<'tcx>, Vec<MonoItem<'tcx>>>,
4545
}
4646

47-
impl<'a, 'b, 'tcx> DirectedGraph for StaticRefGraph<'a, 'b, 'tcx> {
47+
impl<'a, 'tcx> DirectedGraph for StaticRefGraph<'a, 'tcx> {
4848
type Node = StaticNodeIdx;
4949

5050
fn num_nodes(&self) -> usize {
5151
self.statics.len()
5252
}
5353
}
5454

55-
impl<'a, 'b, 'tcx> Successors for StaticRefGraph<'a, 'b, 'tcx> {
55+
impl<'a, 'tcx> Successors for StaticRefGraph<'a, 'tcx> {
5656
fn successors(&self, node_idx: StaticNodeIdx) -> impl Iterator<Item = StaticNodeIdx> {
5757
let def_id = self.statics[node_idx.index()];
5858
self.used_map[&MonoItem::Static(def_id)].iter().filter_map(|&mono_item| match mono_item {

0 commit comments

Comments
 (0)