Remove in_band_lifetimes from rustc_mir_transform

This one is a heavy `'tcx` user.

Two interesting ones:

This one had the `'tcx` declared on the function, despite the trait taking a `'tcx`:
```diff
-impl Visitor<'_> for UsedLocals {
+impl<'tcx> Visitor<'tcx> for UsedLocals {
     fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {
```

This one use in-band for one, and underscore for the other:
```diff
-pub fn remove_dead_blocks(tcx: TyCtxt<'tcx>, body: &mut Body<'_>) {
+pub fn remove_dead_blocks<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
```
This commit is contained in:
Scott McMurray 2021-12-06 00:48:37 -08:00
parent 0b6f079e49
commit a124924061
35 changed files with 117 additions and 119 deletions

View file

@ -180,7 +180,7 @@ impl<'tcx> MockBlocks<'tcx> {
}
}
fn debug_basic_blocks(mir_body: &Body<'tcx>) -> String {
fn debug_basic_blocks<'tcx>(mir_body: &Body<'tcx>) -> String {
format!(
"{:?}",
mir_body
@ -273,7 +273,7 @@ fn print_coverage_graphviz(
}
/// Create a mock `Body` with a simple flow.
fn goto_switchint() -> Body<'a> {
fn goto_switchint<'a>() -> Body<'a> {
let mut blocks = MockBlocks::new();
let start = blocks.call(None);
let goto = blocks.goto(Some(start));
@ -363,7 +363,7 @@ fn test_covgraph_goto_switchint() {
}
/// Create a mock `Body` with a loop.
fn switchint_then_loop_else_return() -> Body<'a> {
fn switchint_then_loop_else_return<'a>() -> Body<'a> {
let mut blocks = MockBlocks::new();
let start = blocks.call(None);
let switchint = blocks.switchint(Some(start));
@ -449,7 +449,7 @@ fn test_covgraph_switchint_then_loop_else_return() {
}
/// Create a mock `Body` with nested loops.
fn switchint_loop_then_inner_loop_else_break() -> Body<'a> {
fn switchint_loop_then_inner_loop_else_break<'a>() -> Body<'a> {
let mut blocks = MockBlocks::new();
let start = blocks.call(None);
let switchint = blocks.switchint(Some(start));