Skip to content

Commit

Permalink
Remove unnecessary -Zunsound-mir-opts uses in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser committed Sep 21, 2020
1 parent eb3eb85 commit 3498511
Show file tree
Hide file tree
Showing 18 changed files with 459 additions and 418 deletions.
2 changes: 1 addition & 1 deletion src/test/mir-opt/inline/inline-any-operand.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z span_free_formats -Zunsound-mir-opts
// compile-flags: -Z span_free_formats

// Tests that MIR inliner works for any operand

Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/inline/inline-trait-method_2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z span_free_formats -Z mir-opt-level=3 -Zunsound-mir-opts
// compile-flags: -Z span_free_formats -Z mir-opt-level=3

// EMIT_MIR inline_trait_method_2.test2.Inline.after.mir
fn test2(x: &dyn X) -> bool {
Expand Down
28 changes: 18 additions & 10 deletions src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ fn bar() -> bool {
let mut _0: bool; // return place in scope 0 at $DIR/inline-any-operand.rs:10:13: 10:17
let _1: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10
let mut _2: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:6
let mut _3: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13
let mut _4: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13
let mut _5: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13
let mut _6: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13
scope 1 {
debug f => _1; // in scope 1 at $DIR/inline-any-operand.rs:11:9: 11:10
scope 2 {
debug x => _3; // in scope 2 at $DIR/inline-any-operand.rs:16:8: 16:9
debug y => _4; // in scope 2 at $DIR/inline-any-operand.rs:16:16: 16:17
debug x => _5; // in scope 2 at $DIR/inline-any-operand.rs:16:8: 16:9
debug y => _6; // in scope 2 at $DIR/inline-any-operand.rs:16:16: 16:17
let mut _3: i32; // in scope 2 at $DIR/inline-any-operand.rs:12:5: 12:13
let mut _4: i32; // in scope 2 at $DIR/inline-any-operand.rs:12:5: 12:13
}
}

Expand All @@ -22,13 +24,19 @@ fn bar() -> bool {
// + literal: Const { ty: fn(i32, i32) -> bool {foo}, val: Value(Scalar(<ZST>)) }
StorageLive(_2); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
_2 = _1; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
StorageLive(_3); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
_3 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageLive(_4); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
_4 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageLive(_5); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
_5 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageLive(_6); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
_6 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageLive(_3); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
_3 = _5; // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
StorageLive(_4); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
_4 = _6; // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
_0 = Eq(move _3, move _4); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
StorageDead(_4); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageDead(_3); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageDead(_4); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
StorageDead(_3); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
StorageDead(_6); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageDead(_5); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
StorageDead(_2); // scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13
StorageDead(_1); // scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2
return; // scope 0 at $DIR/inline-any-operand.rs:13:2: 13:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fn test2(_1: &dyn X) -> bool {
let mut _3: &dyn X; // in scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
scope 1 {
debug x => _2; // in scope 1 at $DIR/inline-trait-method_2.rs:9:9: 9:10
let mut _4: &dyn X; // in scope 1 at $DIR/inline-trait-method_2.rs:5:5: 5:12
}

bb0: {
Expand All @@ -15,13 +16,16 @@ fn test2(_1: &dyn X) -> bool {
_3 = &(*_1); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
_2 = move _3 as &dyn X (Pointer(Unsize)); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
StorageDead(_3); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
_0 = <dyn X as X>::y(move _2) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
StorageLive(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:6
_4 = _2; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:6
_0 = <dyn X as X>::y(move _4) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
// mir::Constant
// + span: $DIR/inline-trait-method_2.rs:10:7: 10:8
// + literal: Const { ty: for<'r> fn(&'r dyn X) -> bool {<dyn X as X>::y}, val: Value(Scalar(<ZST>)) }
}

bb1: {
StorageDead(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:9: 10:10
StorageDead(_2); // scope 0 at $DIR/inline-trait-method_2.rs:5:11: 5:12
return; // scope 0 at $DIR/inline-trait-method_2.rs:6:2: 6:2
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/mir-opt/issue-73223.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// compile-flags: -Zunsound-mir-opts

fn main() {
let split = match Some(1) {
Some(v) => v,
Expand Down
Loading

0 comments on commit 3498511

Please sign in to comment.