Skip to content

Commit 666180c

Browse files
committed
Move 'tcx lifetime on MirPass
1 parent 42dcd4b commit 666180c

21 files changed

+48
-48
lines changed

src/librustc_mir/transform/add_call_guards.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ pub use self::AddCallGuards::*;
3030
*
3131
*/
3232

33-
impl MirPass for AddCallGuards {
34-
fn run_pass<'tcx>(&self, _tcx: TyCtxt<'tcx>, _src: MirSource<'tcx>, body: &mut Body<'tcx>) {
33+
impl<'tcx> MirPass<'tcx> for AddCallGuards {
34+
fn run_pass(&self, _tcx: TyCtxt<'tcx>, _src: MirSource<'tcx>, body: &mut Body<'tcx>) {
3535
self.add_call_guards(body);
3636
}
3737
}

src/librustc_mir/transform/add_moves_for_packed_drops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ use crate::util;
3939

4040
pub struct AddMovesForPackedDrops;
4141

42-
impl MirPass for AddMovesForPackedDrops {
43-
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, src: MirSource<'tcx>, body: &mut Body<'tcx>) {
42+
impl<'tcx> MirPass<'tcx> for AddMovesForPackedDrops {
43+
fn run_pass(&self, tcx: TyCtxt<'tcx>, src: MirSource<'tcx>, body: &mut Body<'tcx>) {
4444
debug!("add_moves_for_packed_drops({:?} @ {:?})", src, body.span);
4545
add_moves_for_packed_drops(tcx, body, src.def_id());
4646
}

src/librustc_mir/transform/add_retag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ fn may_be_reference<'tcx>(ty: Ty<'tcx>) -> bool {
6565
}
6666
}
6767

68-
impl MirPass for AddRetag {
69-
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, _src: MirSource<'tcx>, body: &mut Body<'tcx>) {
68+
impl<'tcx> MirPass<'tcx> for AddRetag {
69+
fn run_pass(&self, tcx: TyCtxt<'tcx>, _src: MirSource<'tcx>, body: &mut Body<'tcx>) {
7070
if !tcx.sess.opts.debugging_opts.mir_emit_retag {
7171
return;
7272
}

src/librustc_mir/transform/cleanup_post_borrowck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ pub struct CleanupNonCodegenStatements;
2626

2727
pub struct DeleteNonCodegenStatements;
2828

29-
impl MirPass for CleanupNonCodegenStatements {
30-
fn run_pass<'tcx>(&self, _tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, body: &mut Body<'tcx>) {
29+
impl<'tcx> MirPass<'tcx> for CleanupNonCodegenStatements {
30+
fn run_pass(&self, _tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, body: &mut Body<'tcx>) {
3131
let mut delete = DeleteNonCodegenStatements;
3232
delete.visit_body(body);
3333
}

src/librustc_mir/transform/const_prop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ use crate::transform::{MirPass, MirSource};
3333

3434
pub struct ConstProp;
3535

36-
impl MirPass for ConstProp {
37-
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) {
36+
impl<'tcx> MirPass<'tcx> for ConstProp {
37+
fn run_pass(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) {
3838
// will be evaluated by miri and produce its errors there
3939
if source.promoted.is_some() {
4040
return;

src/librustc_mir/transform/copy_prop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ use crate::util::def_use::DefUseAnalysis;
2929

3030
pub struct CopyPropagation;
3131

32-
impl MirPass for CopyPropagation {
33-
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, body: &mut Body<'tcx>) {
32+
impl<'tcx> MirPass<'tcx> for CopyPropagation {
33+
fn run_pass(&self, tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, body: &mut Body<'tcx>) {
3434
// We only run when the MIR optimization level is > 1.
3535
// This avoids a slow pass, and messing up debug info.
3636
if tcx.sess.opts.debugging_opts.mir_opt_level <= 1 {

src/librustc_mir/transform/deaggregator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use crate::util::expand_aggregate;
55

66
pub struct Deaggregator;
77

8-
impl MirPass for Deaggregator {
9-
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, body: &mut Body<'tcx>) {
8+
impl<'tcx> MirPass<'tcx> for Deaggregator {
9+
fn run_pass(&self, tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, body: &mut Body<'tcx>) {
1010
let (basic_blocks, local_decls) = body.basic_blocks_and_local_decls_mut();
1111
let local_decls = &*local_decls;
1212
for bb in basic_blocks {

src/librustc_mir/transform/dump_mir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ use crate::util as mir_util;
1313

1414
pub struct Marker(pub &'static str);
1515

16-
impl MirPass for Marker {
16+
impl<'tcx> MirPass<'tcx> for Marker {
1717
fn name(&self) -> Cow<'_, str> {
1818
Cow::Borrowed(self.0)
1919
}
2020

21-
fn run_pass<'tcx>(&self, _tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, _body: &mut Body<'tcx>) {
21+
fn run_pass(&self, _tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, _body: &mut Body<'tcx>) {
2222
}
2323
}
2424

src/librustc_mir/transform/elaborate_drops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use syntax_pos::Span;
2020

2121
pub struct ElaborateDrops;
2222

23-
impl MirPass for ElaborateDrops {
24-
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, src: MirSource<'tcx>, body: &mut Body<'tcx>) {
23+
impl<'tcx> MirPass<'tcx> for ElaborateDrops {
24+
fn run_pass(&self, tcx: TyCtxt<'tcx>, src: MirSource<'tcx>, body: &mut Body<'tcx>) {
2525
debug!("elaborate_drops({:?} @ {:?})", src, body.span);
2626

2727
let def_id = src.def_id();

src/librustc_mir/transform/erase_regions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ impl MutVisitor<'tcx> for EraseRegionsVisitor<'tcx> {
4949

5050
pub struct EraseRegions;
5151

52-
impl MirPass for EraseRegions {
53-
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, _: MirSource<'tcx>, body: &mut Body<'tcx>) {
52+
impl<'tcx> MirPass<'tcx> for EraseRegions {
53+
fn run_pass(&self, tcx: TyCtxt<'tcx>, _: MirSource<'tcx>, body: &mut Body<'tcx>) {
5454
EraseRegionsVisitor::new(tcx).visit_body(body);
5555
}
5656
}

0 commit comments

Comments
 (0)