Skip to content

Commit

Permalink
Auto merge of #103904 - JakobDegen:mir-opt-dash, r=oli-obk
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Nov 3, 2022
2 parents 432b1a4 + 0bd4f76 commit 160b194
Show file tree
Hide file tree
Showing 198 changed files with 3,299 additions and 3,262 deletions.
3 changes: 3 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,9 @@ impl Step for Tidy {
if builder.is_verbose() {
cmd.arg("--verbose");
}
if builder.config.cmd.bless() {
cmd.arg("--bless");
}

builder.info("tidy check");
try_run(builder, &mut cmd);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
// MIR for `borrow_and_cast` after SimplifyCfg-initial

fn borrow_and_cast(_1: i32) -> () {
debug x => _1; // in scope 0 at $DIR/address-of.rs:+0:20: +0:25
let mut _0: (); // return place in scope 0 at $DIR/address-of.rs:+0:32: +0:32
let _2: *const i32; // in scope 0 at $DIR/address-of.rs:+1:9: +1:10
let _3: &i32; // in scope 0 at $DIR/address-of.rs:+1:13: +1:15
let _5: &mut i32; // in scope 0 at $DIR/address-of.rs:+2:13: +2:19
let mut _7: &mut i32; // in scope 0 at $DIR/address-of.rs:+3:13: +3:19
debug x => _1; // in scope 0 at $DIR/address_of.rs:+0:20: +0:25
let mut _0: (); // return place in scope 0 at $DIR/address_of.rs:+0:32: +0:32
let _2: *const i32; // in scope 0 at $DIR/address_of.rs:+1:9: +1:10
let _3: &i32; // in scope 0 at $DIR/address_of.rs:+1:13: +1:15
let _5: &mut i32; // in scope 0 at $DIR/address_of.rs:+2:13: +2:19
let mut _7: &mut i32; // in scope 0 at $DIR/address_of.rs:+3:13: +3:19
scope 1 {
debug p => _2; // in scope 1 at $DIR/address-of.rs:+1:9: +1:10
let _4: *const i32; // in scope 1 at $DIR/address-of.rs:+2:9: +2:10
debug p => _2; // in scope 1 at $DIR/address_of.rs:+1:9: +1:10
let _4: *const i32; // in scope 1 at $DIR/address_of.rs:+2:9: +2:10
scope 2 {
debug q => _4; // in scope 2 at $DIR/address-of.rs:+2:9: +2:10
let _6: *mut i32; // in scope 2 at $DIR/address-of.rs:+3:9: +3:10
debug q => _4; // in scope 2 at $DIR/address_of.rs:+2:9: +2:10
let _6: *mut i32; // in scope 2 at $DIR/address_of.rs:+3:9: +3:10
scope 3 {
debug r => _6; // in scope 3 at $DIR/address-of.rs:+3:9: +3:10
debug r => _6; // in scope 3 at $DIR/address_of.rs:+3:9: +3:10
}
}
}

bb0: {
StorageLive(_2); // scope 0 at $DIR/address-of.rs:+1:9: +1:10
StorageLive(_3); // scope 0 at $DIR/address-of.rs:+1:13: +1:15
_3 = &_1; // scope 0 at $DIR/address-of.rs:+1:13: +1:15
_2 = &raw const (*_3); // scope 0 at $DIR/address-of.rs:+1:13: +1:15
FakeRead(ForLet(None), _2); // scope 0 at $DIR/address-of.rs:+1:9: +1:10
StorageDead(_3); // scope 0 at $DIR/address-of.rs:+1:29: +1:30
StorageLive(_4); // scope 1 at $DIR/address-of.rs:+2:9: +2:10
StorageLive(_5); // scope 1 at $DIR/address-of.rs:+2:13: +2:19
_5 = &mut _1; // scope 1 at $DIR/address-of.rs:+2:13: +2:19
_4 = &raw const (*_5); // scope 1 at $DIR/address-of.rs:+2:13: +2:19
FakeRead(ForLet(None), _4); // scope 1 at $DIR/address-of.rs:+2:9: +2:10
StorageDead(_5); // scope 1 at $DIR/address-of.rs:+2:33: +2:34
StorageLive(_6); // scope 2 at $DIR/address-of.rs:+3:9: +3:10
StorageLive(_7); // scope 2 at $DIR/address-of.rs:+3:13: +3:19
_7 = &mut _1; // scope 2 at $DIR/address-of.rs:+3:13: +3:19
_6 = &raw mut (*_7); // scope 2 at $DIR/address-of.rs:+3:13: +3:19
FakeRead(ForLet(None), _6); // scope 2 at $DIR/address-of.rs:+3:9: +3:10
StorageDead(_7); // scope 2 at $DIR/address-of.rs:+3:31: +3:32
_0 = const (); // scope 0 at $DIR/address-of.rs:+0:32: +4:2
StorageDead(_6); // scope 2 at $DIR/address-of.rs:+4:1: +4:2
StorageDead(_4); // scope 1 at $DIR/address-of.rs:+4:1: +4:2
StorageDead(_2); // scope 0 at $DIR/address-of.rs:+4:1: +4:2
return; // scope 0 at $DIR/address-of.rs:+4:2: +4:2
StorageLive(_2); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
StorageLive(_3); // scope 0 at $DIR/address_of.rs:+1:13: +1:15
_3 = &_1; // scope 0 at $DIR/address_of.rs:+1:13: +1:15
_2 = &raw const (*_3); // scope 0 at $DIR/address_of.rs:+1:13: +1:15
FakeRead(ForLet(None), _2); // scope 0 at $DIR/address_of.rs:+1:9: +1:10
StorageDead(_3); // scope 0 at $DIR/address_of.rs:+1:29: +1:30
StorageLive(_4); // scope 1 at $DIR/address_of.rs:+2:9: +2:10
StorageLive(_5); // scope 1 at $DIR/address_of.rs:+2:13: +2:19
_5 = &mut _1; // scope 1 at $DIR/address_of.rs:+2:13: +2:19
_4 = &raw const (*_5); // scope 1 at $DIR/address_of.rs:+2:13: +2:19
FakeRead(ForLet(None), _4); // scope 1 at $DIR/address_of.rs:+2:9: +2:10
StorageDead(_5); // scope 1 at $DIR/address_of.rs:+2:33: +2:34
StorageLive(_6); // scope 2 at $DIR/address_of.rs:+3:9: +3:10
StorageLive(_7); // scope 2 at $DIR/address_of.rs:+3:13: +3:19
_7 = &mut _1; // scope 2 at $DIR/address_of.rs:+3:13: +3:19
_6 = &raw mut (*_7); // scope 2 at $DIR/address_of.rs:+3:13: +3:19
FakeRead(ForLet(None), _6); // scope 2 at $DIR/address_of.rs:+3:9: +3:10
StorageDead(_7); // scope 2 at $DIR/address_of.rs:+3:31: +3:32
_0 = const (); // scope 0 at $DIR/address_of.rs:+0:32: +4:2
StorageDead(_6); // scope 2 at $DIR/address_of.rs:+4:1: +4:2
StorageDead(_4); // scope 1 at $DIR/address_of.rs:+4:1: +4:2
StorageDead(_2); // scope 0 at $DIR/address_of.rs:+4:1: +4:2
return; // scope 0 at $DIR/address_of.rs:+4:2: +4:2
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
// MIR for `main` after SimplifyCfg-elaborate-drops

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

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

bb1: {
StorageDead(_6); // scope 4 at $DIR/array-index-is-temporary.rs:+4:26: +4:27
StorageLive(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
_7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
_8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
_9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
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
StorageDead(_6); // scope 4 at $DIR/array_index_is_temporary.rs:+4:26: +4:27
StorageLive(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
_7 = _2; // scope 3 at $DIR/array_index_is_temporary.rs:+4:7: +4:8
_8 = Len(_1); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
_9 = Lt(_7, _8); // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:9
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
}

bb2: {
_1[_7] = move _5; // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:29
StorageDead(_5); // scope 3 at $DIR/array-index-is-temporary.rs:+4:28: +4:29
StorageDead(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:29: +4:30
_0 = const (); // scope 0 at $DIR/array-index-is-temporary.rs:+0:11: +5:2
StorageDead(_3); // scope 2 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
StorageDead(_2); // scope 1 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
StorageDead(_1); // scope 0 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
return; // scope 0 at $DIR/array-index-is-temporary.rs:+5:2: +5:2
_1[_7] = move _5; // scope 3 at $DIR/array_index_is_temporary.rs:+4:5: +4:29
StorageDead(_5); // scope 3 at $DIR/array_index_is_temporary.rs:+4:28: +4:29
StorageDead(_7); // scope 3 at $DIR/array_index_is_temporary.rs:+4:29: +4:30
_0 = const (); // scope 0 at $DIR/array_index_is_temporary.rs:+0:11: +5:2
StorageDead(_3); // scope 2 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
StorageDead(_2); // scope 1 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
StorageDead(_1); // scope 0 at $DIR/array_index_is_temporary.rs:+5:1: +5:2
return; // scope 0 at $DIR/array_index_is_temporary.rs:+5:2: +5:2
}
}
Loading

0 comments on commit 160b194

Please sign in to comment.