Skip to content

Commit 521b379

Browse files
committed
Remove unnecessary lifetime on ResultsVisitor.
1 parent 3bd1e14 commit 521b379

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

compiler/rustc_borrowck/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,12 @@ struct MirBorrowckCtxt<'a, 'infcx, 'tcx> {
702702
// 2. loans made in overlapping scopes do not conflict
703703
// 3. assignments do not affect things loaned out as immutable
704704
// 4. moves do not affect things loaned out in any way
705-
impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a, '_, 'tcx> {
705+
impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a, '_, 'tcx> {
706706
fn visit_after_early_statement_effect(
707707
&mut self,
708708
_results: &mut Results<'tcx, Borrowck<'a, 'tcx>>,
709709
state: &BorrowckDomain,
710-
stmt: &'a Statement<'tcx>,
710+
stmt: &Statement<'tcx>,
711711
location: Location,
712712
) {
713713
debug!("MirBorrowckCtxt::process_statement({:?}, {:?}): {:?}", location, stmt, state);
@@ -783,7 +783,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
783783
&mut self,
784784
_results: &mut Results<'tcx, Borrowck<'a, 'tcx>>,
785785
state: &BorrowckDomain,
786-
term: &'a Terminator<'tcx>,
786+
term: &Terminator<'tcx>,
787787
loc: Location,
788788
) {
789789
debug!("MirBorrowckCtxt::process_terminator({:?}, {:?}): {:?}", loc, term, state);
@@ -896,7 +896,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
896896
&mut self,
897897
_results: &mut Results<'tcx, Borrowck<'a, 'tcx>>,
898898
state: &BorrowckDomain,
899-
term: &'a Terminator<'tcx>,
899+
term: &Terminator<'tcx>,
900900
loc: Location,
901901
) {
902902
let span = term.source_info.span;
@@ -1363,7 +1363,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
13631363
fn consume_rvalue(
13641364
&mut self,
13651365
location: Location,
1366-
(rvalue, span): (&'a Rvalue<'tcx>, Span),
1366+
(rvalue, span): (&Rvalue<'tcx>, Span),
13671367
state: &BorrowckDomain,
13681368
) {
13691369
match rvalue {
@@ -1636,7 +1636,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
16361636
fn consume_operand(
16371637
&mut self,
16381638
location: Location,
1639-
(operand, span): (&'a Operand<'tcx>, Span),
1639+
(operand, span): (&Operand<'tcx>, Span),
16401640
state: &BorrowckDomain,
16411641
) {
16421642
match *operand {

compiler/rustc_mir_dataflow/src/framework/direction.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub trait Direction {
4343
block: BasicBlock,
4444
block_data: &'mir mir::BasicBlockData<'tcx>,
4545
results: &mut Results<'tcx, A>,
46-
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
46+
vis: &mut impl ResultsVisitor<'tcx, A>,
4747
) where
4848
A: Analysis<'tcx>;
4949
}
@@ -212,7 +212,7 @@ impl Direction for Backward {
212212
block: BasicBlock,
213213
block_data: &'mir mir::BasicBlockData<'tcx>,
214214
results: &mut Results<'tcx, A>,
215-
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
215+
vis: &mut impl ResultsVisitor<'tcx, A>,
216216
) where
217217
A: Analysis<'tcx>,
218218
{
@@ -394,7 +394,7 @@ impl Direction for Forward {
394394
block: BasicBlock,
395395
block_data: &'mir mir::BasicBlockData<'tcx>,
396396
results: &mut Results<'tcx, A>,
397-
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
397+
vis: &mut impl ResultsVisitor<'tcx, A>,
398398
) where
399399
A: Analysis<'tcx>,
400400
{

compiler/rustc_mir_dataflow/src/framework/graphviz.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ impl<D> StateDiffCollector<D> {
710710
}
711711
}
712712

713-
impl<'tcx, A> ResultsVisitor<'_, 'tcx, A> for StateDiffCollector<A::Domain>
713+
impl<'tcx, A> ResultsVisitor<'tcx, A> for StateDiffCollector<A::Domain>
714714
where
715715
A: Analysis<'tcx>,
716716
A::Domain: DebugWithContext<A>,

compiler/rustc_mir_dataflow/src/framework/results.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ where
4747
&mut self,
4848
body: &'mir Body<'tcx>,
4949
blocks: impl IntoIterator<Item = BasicBlock>,
50-
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
50+
vis: &mut impl ResultsVisitor<'tcx, A>,
5151
) {
5252
visit_results(body, blocks, self, vis)
5353
}
5454

5555
pub fn visit_reachable_with<'mir>(
5656
&mut self,
5757
body: &'mir Body<'tcx>,
58-
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
58+
vis: &mut impl ResultsVisitor<'tcx, A>,
5959
) {
6060
let blocks = traversal::reachable(body);
6161
visit_results(body, blocks.map(|(bb, _)| bb), self, vis)

compiler/rustc_mir_dataflow/src/framework/visitor.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub fn visit_results<'mir, 'tcx, A>(
88
body: &'mir mir::Body<'tcx>,
99
blocks: impl IntoIterator<Item = BasicBlock>,
1010
results: &mut Results<'tcx, A>,
11-
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
11+
vis: &mut impl ResultsVisitor<'tcx, A>,
1212
) where
1313
A: Analysis<'tcx>,
1414
{
@@ -29,7 +29,7 @@ pub fn visit_results<'mir, 'tcx, A>(
2929
/// A visitor over the results of an `Analysis`. Use this when you want to inspect domain values in
3030
/// many or all locations; use `ResultsCursor` if you want to inspect domain values only in certain
3131
/// locations.
32-
pub trait ResultsVisitor<'mir, 'tcx, A>
32+
pub trait ResultsVisitor<'tcx, A>
3333
where
3434
A: Analysis<'tcx>,
3535
{
@@ -40,7 +40,7 @@ where
4040
&mut self,
4141
_results: &mut Results<'tcx, A>,
4242
_state: &A::Domain,
43-
_statement: &'mir mir::Statement<'tcx>,
43+
_statement: &mir::Statement<'tcx>,
4444
_location: Location,
4545
) {
4646
}
@@ -50,7 +50,7 @@ where
5050
&mut self,
5151
_results: &mut Results<'tcx, A>,
5252
_state: &A::Domain,
53-
_statement: &'mir mir::Statement<'tcx>,
53+
_statement: &mir::Statement<'tcx>,
5454
_location: Location,
5555
) {
5656
}
@@ -60,7 +60,7 @@ where
6060
&mut self,
6161
_results: &mut Results<'tcx, A>,
6262
_state: &A::Domain,
63-
_terminator: &'mir mir::Terminator<'tcx>,
63+
_terminator: &mir::Terminator<'tcx>,
6464
_location: Location,
6565
) {
6666
}
@@ -72,7 +72,7 @@ where
7272
&mut self,
7373
_results: &mut Results<'tcx, A>,
7474
_state: &A::Domain,
75-
_terminator: &'mir mir::Terminator<'tcx>,
75+
_terminator: &mir::Terminator<'tcx>,
7676
_location: Location,
7777
) {
7878
}

compiler/rustc_mir_dataflow/src/points.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ struct Visitor<'a, N: Idx> {
120120
values: SparseIntervalMatrix<N, PointIndex>,
121121
}
122122

123-
impl<'mir, 'tcx, A, N> ResultsVisitor<'mir, 'tcx, A> for Visitor<'_, N>
123+
impl<'tcx, A, N> ResultsVisitor<'tcx, A> for Visitor<'_, N>
124124
where
125125
A: Analysis<'tcx, Domain = DenseBitSet<N>>,
126126
N: Idx,
127127
{
128-
fn visit_after_primary_statement_effect(
128+
fn visit_after_primary_statement_effect<'mir>(
129129
&mut self,
130130
_results: &mut Results<'tcx, A>,
131131
state: &A::Domain,
@@ -139,7 +139,7 @@ where
139139
});
140140
}
141141

142-
fn visit_after_primary_terminator_effect(
142+
fn visit_after_primary_terminator_effect<'mir>(
143143
&mut self,
144144
_results: &mut Results<'tcx, A>,
145145
state: &A::Domain,

compiler/rustc_mir_transform/src/coroutine.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -875,14 +875,14 @@ struct StorageConflictVisitor<'a, 'tcx> {
875875
eligible_storage_live: DenseBitSet<Local>,
876876
}
877877

878-
impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, MaybeRequiresStorage<'a, 'tcx>>
878+
impl<'a, 'tcx> ResultsVisitor<'tcx, MaybeRequiresStorage<'a, 'tcx>>
879879
for StorageConflictVisitor<'a, 'tcx>
880880
{
881881
fn visit_after_early_statement_effect(
882882
&mut self,
883883
_results: &mut Results<'tcx, MaybeRequiresStorage<'a, 'tcx>>,
884884
state: &DenseBitSet<Local>,
885-
_statement: &'a Statement<'tcx>,
885+
_statement: &Statement<'tcx>,
886886
loc: Location,
887887
) {
888888
self.apply_state(state, loc);
@@ -892,7 +892,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, MaybeRequiresStorage<'a, 'tcx>>
892892
&mut self,
893893
_results: &mut Results<'tcx, MaybeRequiresStorage<'a, 'tcx>>,
894894
state: &DenseBitSet<Local>,
895-
_terminator: &'a Terminator<'tcx>,
895+
_terminator: &Terminator<'tcx>,
896896
loc: Location,
897897
) {
898898
self.apply_state(state, loc);

compiler/rustc_mir_transform/src/dataflow_const_prop.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -958,13 +958,13 @@ fn try_write_constant<'tcx>(
958958
interp_ok(())
959959
}
960960

961-
impl<'mir, 'tcx> ResultsVisitor<'mir, 'tcx, ConstAnalysis<'_, 'tcx>> for Collector<'_, 'tcx> {
961+
impl<'tcx> ResultsVisitor<'tcx, ConstAnalysis<'_, 'tcx>> for Collector<'_, 'tcx> {
962962
#[instrument(level = "trace", skip(self, results, statement))]
963963
fn visit_after_early_statement_effect(
964964
&mut self,
965965
results: &mut Results<'tcx, ConstAnalysis<'_, 'tcx>>,
966966
state: &State<FlatSet<Scalar>>,
967-
statement: &'mir Statement<'tcx>,
967+
statement: &Statement<'tcx>,
968968
location: Location,
969969
) {
970970
match &statement.kind {
@@ -986,7 +986,7 @@ impl<'mir, 'tcx> ResultsVisitor<'mir, 'tcx, ConstAnalysis<'_, 'tcx>> for Collect
986986
&mut self,
987987
results: &mut Results<'tcx, ConstAnalysis<'_, 'tcx>>,
988988
state: &State<FlatSet<Scalar>>,
989-
statement: &'mir Statement<'tcx>,
989+
statement: &Statement<'tcx>,
990990
location: Location,
991991
) {
992992
match statement.kind {
@@ -1011,7 +1011,7 @@ impl<'mir, 'tcx> ResultsVisitor<'mir, 'tcx, ConstAnalysis<'_, 'tcx>> for Collect
10111011
&mut self,
10121012
results: &mut Results<'tcx, ConstAnalysis<'_, 'tcx>>,
10131013
state: &State<FlatSet<Scalar>>,
1014-
terminator: &'mir Terminator<'tcx>,
1014+
terminator: &Terminator<'tcx>,
10151015
location: Location,
10161016
) {
10171017
OperandCollector {

0 commit comments

Comments
 (0)