Remove unnecessary lifetime on ResultsVisitor.

This commit is contained in:
Nicholas Nethercote
2025-04-22 10:08:05 +10:00
parent 3bd1e1484f
commit 521b379705
8 changed files with 28 additions and 28 deletions

View File

@@ -43,7 +43,7 @@ pub trait Direction {
block: BasicBlock,
block_data: &'mir mir::BasicBlockData<'tcx>,
results: &mut Results<'tcx, A>,
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
vis: &mut impl ResultsVisitor<'tcx, A>,
) where
A: Analysis<'tcx>;
}
@@ -212,7 +212,7 @@ impl Direction for Backward {
block: BasicBlock,
block_data: &'mir mir::BasicBlockData<'tcx>,
results: &mut Results<'tcx, A>,
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
vis: &mut impl ResultsVisitor<'tcx, A>,
) where
A: Analysis<'tcx>,
{
@@ -394,7 +394,7 @@ impl Direction for Forward {
block: BasicBlock,
block_data: &'mir mir::BasicBlockData<'tcx>,
results: &mut Results<'tcx, A>,
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
vis: &mut impl ResultsVisitor<'tcx, A>,
) where
A: Analysis<'tcx>,
{

View File

@@ -710,7 +710,7 @@ impl<D> StateDiffCollector<D> {
}
}
impl<'tcx, A> ResultsVisitor<'_, 'tcx, A> for StateDiffCollector<A::Domain>
impl<'tcx, A> ResultsVisitor<'tcx, A> for StateDiffCollector<A::Domain>
where
A: Analysis<'tcx>,
A::Domain: DebugWithContext<A>,

View File

@@ -47,7 +47,7 @@ where
&mut self,
body: &'mir Body<'tcx>,
blocks: impl IntoIterator<Item = BasicBlock>,
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
vis: &mut impl ResultsVisitor<'tcx, A>,
) {
visit_results(body, blocks, self, vis)
}
@@ -55,7 +55,7 @@ where
pub fn visit_reachable_with<'mir>(
&mut self,
body: &'mir Body<'tcx>,
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
vis: &mut impl ResultsVisitor<'tcx, A>,
) {
let blocks = traversal::reachable(body);
visit_results(body, blocks.map(|(bb, _)| bb), self, vis)

View File

@@ -8,7 +8,7 @@ pub fn visit_results<'mir, 'tcx, A>(
body: &'mir mir::Body<'tcx>,
blocks: impl IntoIterator<Item = BasicBlock>,
results: &mut Results<'tcx, A>,
vis: &mut impl ResultsVisitor<'mir, 'tcx, A>,
vis: &mut impl ResultsVisitor<'tcx, A>,
) where
A: Analysis<'tcx>,
{
@@ -29,7 +29,7 @@ pub fn visit_results<'mir, 'tcx, A>(
/// A visitor over the results of an `Analysis`. Use this when you want to inspect domain values in
/// many or all locations; use `ResultsCursor` if you want to inspect domain values only in certain
/// locations.
pub trait ResultsVisitor<'mir, 'tcx, A>
pub trait ResultsVisitor<'tcx, A>
where
A: Analysis<'tcx>,
{
@@ -40,7 +40,7 @@ where
&mut self,
_results: &mut Results<'tcx, A>,
_state: &A::Domain,
_statement: &'mir mir::Statement<'tcx>,
_statement: &mir::Statement<'tcx>,
_location: Location,
) {
}
@@ -50,7 +50,7 @@ where
&mut self,
_results: &mut Results<'tcx, A>,
_state: &A::Domain,
_statement: &'mir mir::Statement<'tcx>,
_statement: &mir::Statement<'tcx>,
_location: Location,
) {
}
@@ -60,7 +60,7 @@ where
&mut self,
_results: &mut Results<'tcx, A>,
_state: &A::Domain,
_terminator: &'mir mir::Terminator<'tcx>,
_terminator: &mir::Terminator<'tcx>,
_location: Location,
) {
}
@@ -72,7 +72,7 @@ where
&mut self,
_results: &mut Results<'tcx, A>,
_state: &A::Domain,
_terminator: &'mir mir::Terminator<'tcx>,
_terminator: &mir::Terminator<'tcx>,
_location: Location,
) {
}

View File

@@ -120,12 +120,12 @@ struct Visitor<'a, N: Idx> {
values: SparseIntervalMatrix<N, PointIndex>,
}
impl<'mir, 'tcx, A, N> ResultsVisitor<'mir, 'tcx, A> for Visitor<'_, N>
impl<'tcx, A, N> ResultsVisitor<'tcx, A> for Visitor<'_, N>
where
A: Analysis<'tcx, Domain = DenseBitSet<N>>,
N: Idx,
{
fn visit_after_primary_statement_effect(
fn visit_after_primary_statement_effect<'mir>(
&mut self,
_results: &mut Results<'tcx, A>,
state: &A::Domain,
@@ -139,7 +139,7 @@ where
});
}
fn visit_after_primary_terminator_effect(
fn visit_after_primary_terminator_effect<'mir>(
&mut self,
_results: &mut Results<'tcx, A>,
state: &A::Domain,