diff options
| author | bors <bors@rust-lang.org> | 2022-07-28 16:22:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-07-28 16:22:19 +0000 |
| commit | 36f4f4aa38563d0c02bbdbbc03fb20145edef567 (patch) | |
| tree | 9ccd853d5a9097d70f30a26016de023231841a96 /src/test/mir-opt/inline/inline_diverging.g.Inline.diff | |
| parent | e5682615bb4fdb90e3a37b810a1b7bded2a1199e (diff) | |
| parent | 11c0280798da8f4d65dec25764237d2354e65273 (diff) | |
Auto merge of #99780 - Nilstrieb:mir-opt-test-line-no, r=oli-obk
Use line numbers relative to the function in mir-opt tests As shown in #99770, the line numbers can be a big source of needless and confusing diffs. This PR adds a new flag `-Zmir-pretty-relative-line-numbers` to make them relative to the function declaration, which avoids most needless diffs from attribute changes. `@JakobDegen` told me that there has been a zulip conversation about disabling line numbers with mixed opinions, so I'd like to get some feedback here, for this hopefully better solution. r? rust-lang/wg-mir-opt
Diffstat (limited to 'src/test/mir-opt/inline/inline_diverging.g.Inline.diff')
| -rw-r--r-- | src/test/mir-opt/inline/inline_diverging.g.Inline.diff | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff index 595df0aed5f..acdd0f87901 100644 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff @@ -2,38 +2,38 @@ + // MIR for `g` after Inline fn g(_1: i32) -> u32 { - debug i => _1; // in scope 0 at $DIR/inline-diverging.rs:12:10: 12:11 - let mut _0: u32; // return place in scope 0 at $DIR/inline-diverging.rs:12:21: 12:24 - let mut _2: bool; // in scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - let mut _3: i32; // in scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - let mut _4: i32; // in scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - let mut _5: !; // in scope 0 at $DIR/inline-diverging.rs:15:12: 17:6 - let _6: !; // in scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 + debug i => _1; // in scope 0 at $DIR/inline-diverging.rs:+0:10: +0:11 + let mut _0: u32; // return place in scope 0 at $DIR/inline-diverging.rs:+0:21: +0:24 + let mut _2: bool; // in scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 + let mut _3: i32; // in scope 0 at $DIR/inline-diverging.rs:+1:8: +1:9 + let mut _4: i32; // in scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10 + let mut _5: !; // in scope 0 at $DIR/inline-diverging.rs:+3:12: +5:6 + let _6: !; // in scope 0 at $DIR/inline-diverging.rs:+4:9: +4:16 + scope 1 (inlined panic) { // at $DIR/inline-diverging.rs:16:9: 16:16 + let mut _7: !; // in scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + } bb0: { - StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageLive(_3); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - _3 = _1; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageDead(_3); // scope 0 at $DIR/inline-diverging.rs:13:12: 13:13 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 + StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 + StorageLive(_3); // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:9 + _3 = _1; // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:9 + _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 + StorageDead(_3); // scope 0 at $DIR/inline-diverging.rs:+1:12: +1:13 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 } bb1: { - StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _4 = _1; // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:17 - StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:14:16: 14:17 - StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:17:5: 17:6 - return; // scope 0 at $DIR/inline-diverging.rs:18:2: 18:2 + StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10 + _4 = _1; // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10 + _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:17 + StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:+2:16: +2:17 + StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:+5:5: +5:6 + return; // scope 0 at $DIR/inline-diverging.rs:+6:2: +6:2 } bb2: { - StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 -- _6 = panic(); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 + StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:+4:9: +4:16 +- _6 = panic(); // scope 0 at $DIR/inline-diverging.rs:+4:9: +4:16 + StorageLive(_7); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + _7 = begin_panic::<&str>(const "explicit panic"); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant @@ -47,7 +47,7 @@ + } + + bb3 (cleanup): { -+ resume; // scope 0 at $DIR/inline-diverging.rs:12:1: 18:2 ++ resume; // scope 0 at $DIR/inline-diverging.rs:+0:1: +6:2 } } |
