Skip to content

Commit 160b194

Browse files
committed
Auto merge of rust-lang#103904 - JakobDegen:mir-opt-dash, r=oli-obk
Ban dashes in miropt test file names Dashes in miropt test file names are annoying - specifically, they cause the test files to not be sorted next to their outputs, which makes it very difficult to tell what goes with what. This PR changes all files to use underscores and adds a blessable tidy check that enforces this. r? `@jyn514` This PR is obviously going to bitrot very quickly. Because of this, I'm going to wait at least 48 hours and until review comes back to allow people from `@rust-lang/wg-mir-opt` or elsewhere to lodge complaints if there are any. If not, I'll rebase the branch on Friday afternoon PST and ask that it be `r+`'d with `p=1` at that time.
2 parents 432b1a4 + 0bd4f76 commit 160b194

File tree

198 files changed

+3299
-3262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+3299
-3262
lines changed

src/bootstrap/test.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,9 @@ impl Step for Tidy {
10521052
if builder.is_verbose() {
10531053
cmd.arg("--verbose");
10541054
}
1055+
if builder.config.cmd.bless() {
1056+
cmd.arg("--bless");
1057+
}
10551058

10561059
builder.info("tidy check");
10571060
try_run(builder, &mut cmd);

src/test/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir

+271-271
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
// MIR for `borrow_and_cast` after SimplifyCfg-initial
22

33
fn borrow_and_cast(_1: i32) -> () {
4-
debug x => _1; // in scope 0 at $DIR/address-of.rs:+0:20: +0:25
5-
let mut _0: (); // return place in scope 0 at $DIR/address-of.rs:+0:32: +0:32
6-
let _2: *const i32; // in scope 0 at $DIR/address-of.rs:+1:9: +1:10
7-
let _3: &i32; // in scope 0 at $DIR/address-of.rs:+1:13: +1:15
8-
let _5: &mut i32; // in scope 0 at $DIR/address-of.rs:+2:13: +2:19
9-
let mut _7: &mut i32; // in scope 0 at $DIR/address-of.rs:+3:13: +3:19
4+
debug x => _1; // in scope 0 at $DIR/address_of.rs:+0:20: +0:25
5+
let mut _0: (); // return place in scope 0 at $DIR/address_of.rs:+0:32: +0:32
6+
let _2: *const i32; // in scope 0 at $DIR/address_of.rs:+1:9: +1:10
7+
let _3: &i32; // in scope 0 at $DIR/address_of.rs:+1:13: +1:15
8+
let _5: &mut i32; // in scope 0 at $DIR/address_of.rs:+2:13: +2:19
9+
let mut _7: &mut i32; // in scope 0 at $DIR/address_of.rs:+3:13: +3:19
1010
scope 1 {
11-
debug p => _2; // in scope 1 at $DIR/address-of.rs:+1:9: +1:10
12-
let _4: *const i32; // in scope 1 at $DIR/address-of.rs:+2:9: +2:10
11+
debug p => _2; // in scope 1 at $DIR/address_of.rs:+1:9: +1:10
12+
let _4: *const i32; // in scope 1 at $DIR/address_of.rs:+2:9: +2:10
1313
scope 2 {
14-
debug q => _4; // in scope 2 at $DIR/address-of.rs:+2:9: +2:10
15-
let _6: *mut i32; // in scope 2 at $DIR/address-of.rs:+3:9: +3:10
14+
debug q => _4; // in scope 2 at $DIR/address_of.rs:+2:9: +2:10
15+
let _6: *mut i32; // in scope 2 at $DIR/address_of.rs:+3:9: +3:10
1616
scope 3 {
17-
debug r => _6; // in scope 3 at $DIR/address-of.rs:+3:9: +3:10
17+
debug r => _6; // in scope 3 at $DIR/address_of.rs:+3:9: +3:10
1818
}
1919
}
2020
}
2121

2222
bb0: {
23-
StorageLive(_2); // scope 0 at $DIR/address-of.rs:+1:9: +1:10
24-
StorageLive(_3); // scope 0 at $DIR/address-of.rs:+1:13: +1:15
25-
_3 = &_1; // scope 0 at $DIR/address-of.rs:+1:13: +1:15
26-
_2 = &raw const (*_3); // scope 0 at $DIR/address-of.rs:+1:13: +1:15
27-
FakeRead(ForLet(None), _2); // scope 0 at $DIR/address-of.rs:+1:9: +1:10
28-
StorageDead(_3); // scope 0 at $DIR/address-of.rs:+1:29: +1:30
29-
StorageLive(_4); // scope 1 at $DIR/address-of.rs:+2:9: +2:10
30-
StorageLive(_5); // scope 1 at $DIR/address-of.rs:+2:13: +2:19
31-
_5 = &mut _1; // scope 1 at $DIR/address-of.rs:+2:13: +2:19
32-
_4 = &raw const (*_5); // scope 1 at $DIR/address-of.rs:+2:13: +2:19
33-
FakeRead(ForLet(None), _4); // scope 1 at $DIR/address-of.rs:+2:9: +2:10
34-
StorageDead(_5); // scope 1 at $DIR/address-of.rs:+2:33: +2:34
35-
StorageLive(_6); // scope 2 at $DIR/address-of.rs:+3:9: +3:10
36-
StorageLive(_7); // scope 2 at $DIR/address-of.rs:+3:13: +3:19
37-
_7 = &mut _1; // scope 2 at $DIR/address-of.rs:+3:13: +3:19
38-
_6 = &raw mut (*_7); // scope 2 at $DIR/address-of.rs:+3:13: +3:19
39-
FakeRead(ForLet(None), _6); // scope 2 at $DIR/address-of.rs:+3:9: +3:10
40-
StorageDead(_7); // scope 2 at $DIR/address-of.rs:+3:31: +3:32
41-
_0 = const (); // scope 0 at $DIR/address-of.rs:+0:32: +4:2
42-
StorageDead(_6); // scope 2 at $DIR/address-of.rs:+4:1: +4:2
43-
StorageDead(_4); // scope 1 at $DIR/address-of.rs:+4:1: +4:2
44-
StorageDead(_2); // scope 0 at $DIR/address-of.rs:+4:1: +4:2
45-
return; // scope 0 at $DIR/address-of.rs:+4:2: +4:2
23+
StorageLive(_2); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
24+
StorageLive(_3); // scope 0 at $DIR/address_of.rs:+1:13: +1:15
25+
_3 = &_1; // scope 0 at $DIR/address_of.rs:+1:13: +1:15
26+
_2 = &raw const (*_3); // scope 0 at $DIR/address_of.rs:+1:13: +1:15
27+
FakeRead(ForLet(None), _2); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
28+
StorageDead(_3); // scope 0 at $DIR/address_of.rs:+1:29: +1:30
29+
StorageLive(_4); // scope 1 at $DIR/address_of.rs:+2:9: +2:10
30+
StorageLive(_5); // scope 1 at $DIR/address_of.rs:+2:13: +2:19
31+
_5 = &mut _1; // scope 1 at $DIR/address_of.rs:+2:13: +2:19
32+
_4 = &raw const (*_5); // scope 1 at $DIR/address_of.rs:+2:13: +2:19
33+
FakeRead(ForLet(None), _4); // scope 1 at $DIR/address_of.rs:+2:9: +2:10
34+
StorageDead(_5); // scope 1 at $DIR/address_of.rs:+2:33: +2:34
35+
StorageLive(_6); // scope 2 at $DIR/address_of.rs:+3:9: +3:10
36+
StorageLive(_7); // scope 2 at $DIR/address_of.rs:+3:13: +3:19
37+
_7 = &mut _1; // scope 2 at $DIR/address_of.rs:+3:13: +3:19
38+
_6 = &raw mut (*_7); // scope 2 at $DIR/address_of.rs:+3:13: +3:19
39+
FakeRead(ForLet(None), _6); // scope 2 at $DIR/address_of.rs:+3:9: +3:10
40+
StorageDead(_7); // scope 2 at $DIR/address_of.rs:+3:31: +3:32
41+
_0 = const (); // scope 0 at $DIR/address_of.rs:+0:32: +4:2
42+
StorageDead(_6); // scope 2 at $DIR/address_of.rs:+4:1: +4:2
43+
StorageDead(_4); // scope 1 at $DIR/address_of.rs:+4:1: +4:2
44+
StorageDead(_2); // scope 0 at $DIR/address_of.rs:+4:1: +4:2
45+
return; // scope 0 at $DIR/address_of.rs:+4:2: +4:2
4646
}
4747
}
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
// MIR for `main` after SimplifyCfg-elaborate-drops
22

33
fn main() -> () {
4-
let mut _0: (); // return place in scope 0 at $DIR/array-index-is-temporary.rs:+0:11: +0:11
5-
let mut _1: [u32; 3]; // in scope 0 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
6-
let mut _4: &mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
7-
let mut _5: u32; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:12: +4:29
8-
let mut _6: *mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
9-
let _7: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
10-
let mut _8: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
11-
let mut _9: bool; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
4+
let mut _0: (); // return place in scope 0 at $DIR/array_index_is_temporary.rs:+0:11: +0:11
5+
let mut _1: [u32; 3]; // in scope 0 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
6+
let mut _4: &mut usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
7+
let mut _5: u32; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:12: +4:29
8+
let mut _6: *mut usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
9+
let _7: usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
10+
let mut _8: usize; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
11+
let mut _9: bool; // in scope 0 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
1212
scope 1 {
13-
debug x => _1; // in scope 1 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
14-
let mut _2: usize; // in scope 1 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
13+
debug x => _1; // in scope 1 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
14+
let mut _2: usize; // in scope 1 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
1515
scope 2 {
16-
debug y => _2; // in scope 2 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
17-
let _3: *mut usize; // in scope 2 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
16+
debug y => _2; // in scope 2 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
17+
let _3: *mut usize; // in scope 2 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
1818
scope 3 {
19-
debug z => _3; // in scope 3 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
19+
debug z => _3; // in scope 3 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
2020
scope 4 {
2121
}
2222
}
2323
}
2424
}
2525

2626
bb0: {
27-
StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
28-
_1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array-index-is-temporary.rs:+1:17: +1:29
29-
StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
30-
_2 = const 1_usize; // scope 1 at $DIR/array-index-is-temporary.rs:+2:17: +2:18
31-
StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
32-
StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
33-
_4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
34-
_3 = &raw mut (*_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
35-
StorageDead(_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:31: +3:32
36-
StorageLive(_5); // scope 3 at $DIR/array-index-is-temporary.rs:+4:12: +4:29
37-
StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
38-
_6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
39-
_5 = foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:+4:21: +4:27
27+
StorageLive(_1); // scope 0 at $DIR/array_index_is_temporary.rs:+1:9: +1:14
28+
_1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array_index_is_temporary.rs:+1:17: +1:29
29+
StorageLive(_2); // scope 1 at $DIR/array_index_is_temporary.rs:+2:9: +2:14
30+
_2 = const 1_usize; // scope 1 at $DIR/array_index_is_temporary.rs:+2:17: +2:18
31+
StorageLive(_3); // scope 2 at $DIR/array_index_is_temporary.rs:+3:9: +3:10
32+
StorageLive(_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
33+
_4 = &mut _2; // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
34+
_3 = &raw mut (*_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:25: +3:31
35+
StorageDead(_4); // scope 2 at $DIR/array_index_is_temporary.rs:+3:31: +3:32
36+
StorageLive(_5); // scope 3 at $DIR/array_index_is_temporary.rs:+4:12: +4:29
37+
StorageLive(_6); // scope 4 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
38+
_6 = _3; // scope 4 at $DIR/array_index_is_temporary.rs:+4:25: +4:26
39+
_5 = foo(move _6) -> bb1; // scope 4 at $DIR/array_index_is_temporary.rs:+4:21: +4:27
4040
// mir::Constant
41-
// + span: $DIR/array-index-is-temporary.rs:16:21: 16:24
41+
// + span: $DIR/array_index_is_temporary.rs:16:21: 16:24
4242
// + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(<ZST>) }
4343
}
4444

4545
bb1: {
46-
StorageDead(_6); // scope 4 at $DIR/array-index-is-temporary.rs:+4:26: +4:27
47-
StorageLive(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
48-
_7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
49-
_8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
50-
_9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
51-
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
46+
StorageDead(_6); // scope 4 at $DIR/array_index_is_temporary.rs:+4:26: +4:27
47+
StorageLive(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
48+
_7 = _2; // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
49+
_8 = Len(_1); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
50+
_9 = Lt(_7, _8); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
51+
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
5252
}
5353

5454
bb2: {
55-
_1[_7] = move _5; // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:29
56-
StorageDead(_5); // scope 3 at $DIR/array-index-is-temporary.rs:+4:28: +4:29
57-
StorageDead(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:29: +4:30
58-
_0 = const (); // scope 0 at $DIR/array-index-is-temporary.rs:+0:11: +5:2
59-
StorageDead(_3); // scope 2 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
60-
StorageDead(_2); // scope 1 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
61-
StorageDead(_1); // scope 0 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
62-
return; // scope 0 at $DIR/array-index-is-temporary.rs:+5:2: +5:2
55+
_1[_7] = move _5; // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:29
56+
StorageDead(_5); // scope 3 at $DIR/array_index_is_temporary.rs:+4:28: +4:29
57+
StorageDead(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:29: +4:30
58+
_0 = const (); // scope 0 at $DIR/array_index_is_temporary.rs:+0:11: +5:2
59+
StorageDead(_3); // scope 2 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
60+
StorageDead(_2); // scope 1 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
61+
StorageDead(_1); // scope 0 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
62+
return; // scope 0 at $DIR/array_index_is_temporary.rs:+5:2: +5:2
6363
}
6464
}

0 commit comments

Comments
 (0)