Skip to content
/ rust Public
forked from rust-lang/rust

Commit 675360a

Browse files
committed
Remove some unnecessary lifetimes.
`FlowSensitiveAnalysis` is only instantiated with the first two lifetimes being the same.
1 parent 78f2104 commit 675360a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

compiler/rustc_const_eval/src/check_consts/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use crate::check_consts::is_fn_or_trait_safe_to_expose_on_stable;
3434
use crate::errors;
3535

3636
type QualifResults<'mir, 'tcx, Q> =
37-
rustc_mir_dataflow::ResultsCursor<'mir, 'tcx, FlowSensitiveAnalysis<'mir, 'mir, 'tcx, Q>>;
37+
rustc_mir_dataflow::ResultsCursor<'mir, 'tcx, FlowSensitiveAnalysis<'mir, 'tcx, Q>>;
3838

3939
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
4040
enum ConstConditionsHold {

compiler/rustc_const_eval/src/check_consts/resolver.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ use super::{ConstCx, Qualif, qualifs};
2222
/// qualified immediately after it is borrowed or its address escapes. The borrow must allow for
2323
/// mutation, which includes shared borrows of places with interior mutability. The type of
2424
/// borrowed place must contain the qualif.
25-
struct TransferFunction<'a, 'mir, 'tcx, Q> {
26-
ccx: &'a ConstCx<'mir, 'tcx>,
27-
state: &'a mut State,
25+
struct TransferFunction<'mir, 'tcx, Q> {
26+
ccx: &'mir ConstCx<'mir, 'tcx>,
27+
state: &'mir mut State,
2828
_qualif: PhantomData<Q>,
2929
}
3030

31-
impl<'a, 'mir, 'tcx, Q> TransferFunction<'a, 'mir, 'tcx, Q>
31+
impl<'mir, 'tcx, Q> TransferFunction<'mir, 'tcx, Q>
3232
where
3333
Q: Qualif,
3434
{
35-
fn new(ccx: &'a ConstCx<'mir, 'tcx>, state: &'a mut State) -> Self {
35+
fn new(ccx: &'mir ConstCx<'mir, 'tcx>, state: &'mir mut State) -> Self {
3636
TransferFunction { ccx, state, _qualif: PhantomData }
3737
}
3838

@@ -124,7 +124,7 @@ where
124124
}
125125
}
126126

127-
impl<'tcx, Q> Visitor<'tcx> for TransferFunction<'_, '_, 'tcx, Q>
127+
impl<'tcx, Q> Visitor<'tcx> for TransferFunction<'_, 'tcx, Q>
128128
where
129129
Q: Qualif,
130130
{
@@ -228,20 +228,20 @@ where
228228
}
229229

230230
/// The dataflow analysis used to propagate qualifs on arbitrary CFGs.
231-
pub(super) struct FlowSensitiveAnalysis<'a, 'mir, 'tcx, Q> {
232-
ccx: &'a ConstCx<'mir, 'tcx>,
231+
pub(super) struct FlowSensitiveAnalysis<'mir, 'tcx, Q> {
232+
ccx: &'mir ConstCx<'mir, 'tcx>,
233233
_qualif: PhantomData<Q>,
234234
}
235235

236-
impl<'a, 'mir, 'tcx, Q> FlowSensitiveAnalysis<'a, 'mir, 'tcx, Q>
236+
impl<'mir, 'tcx, Q> FlowSensitiveAnalysis<'mir, 'tcx, Q>
237237
where
238238
Q: Qualif,
239239
{
240-
pub(super) fn new(_: Q, ccx: &'a ConstCx<'mir, 'tcx>) -> Self {
240+
pub(super) fn new(_: Q, ccx: &'mir ConstCx<'mir, 'tcx>) -> Self {
241241
FlowSensitiveAnalysis { ccx, _qualif: PhantomData }
242242
}
243243

244-
fn transfer_function(&self, state: &'a mut State) -> TransferFunction<'a, 'mir, 'tcx, Q> {
244+
fn transfer_function(&self, state: &'mir mut State) -> TransferFunction<'mir, 'tcx, Q> {
245245
TransferFunction::<Q>::new(self.ccx, state)
246246
}
247247
}
@@ -313,7 +313,7 @@ impl JoinSemiLattice for State {
313313
}
314314
}
315315

316-
impl<'tcx, Q> Analysis<'tcx> for FlowSensitiveAnalysis<'_, '_, 'tcx, Q>
316+
impl<'tcx, Q> Analysis<'tcx> for FlowSensitiveAnalysis<'_, 'tcx, Q>
317317
where
318318
Q: Qualif,
319319
{

0 commit comments

Comments
 (0)