diff options
Diffstat (limited to 'src')
26 files changed, 169 insertions, 576 deletions
diff --git a/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff index a8f04c9fc7f..bf9ab866938 100644 --- a/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff +++ b/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff @@ -4,9 +4,8 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/cast.rs:+0:11: +0:11 let _1: i32; // in scope 0 at $DIR/cast.rs:+1:9: +1:10 - let mut _3: u8; // in scope 0 at $DIR/cast.rs:+2:13: +2:22 - let mut _4: i32; // in scope 0 at $DIR/cast.rs:+2:13: +2:16 - let mut _5: &i32; // in scope 0 at $DIR/cast.rs:+2:14: +2:16 + let mut _3: u8; // in scope 0 at $DIR/cast.rs:+2:13: +2:20 + let mut _4: i32; // in scope 0 at $DIR/cast.rs:+2:13: +2:14 scope 1 { debug a => _1; // in scope 1 at $DIR/cast.rs:+1:9: +1:10 let _2: u8; // in scope 1 at $DIR/cast.rs:+2:9: +2:10 @@ -19,19 +18,16 @@ StorageLive(_1); // scope 0 at $DIR/cast.rs:+1:9: +1:10 _1 = const 257_i32; // scope 0 at $DIR/cast.rs:+1:13: +1:16 StorageLive(_2); // scope 1 at $DIR/cast.rs:+2:9: +2:10 - StorageLive(_3); // scope 1 at $DIR/cast.rs:+2:13: +2:22 - StorageLive(_4); // scope 1 at $DIR/cast.rs:+2:13: +2:16 - StorageLive(_5); // scope 1 at $DIR/cast.rs:+2:14: +2:16 - _5 = &_1; // scope 1 at $DIR/cast.rs:+2:14: +2:16 -- _4 = (*_5); // scope 1 at $DIR/cast.rs:+2:13: +2:16 -- _3 = move _4 as u8 (IntToInt); // scope 1 at $DIR/cast.rs:+2:13: +2:22 -+ _4 = const 257_i32; // scope 1 at $DIR/cast.rs:+2:13: +2:16 -+ _3 = const 1_u8; // scope 1 at $DIR/cast.rs:+2:13: +2:22 - StorageDead(_4); // scope 1 at $DIR/cast.rs:+2:21: +2:22 -- _2 = Add(move _3, const 1_u8); // scope 1 at $DIR/cast.rs:+2:13: +2:26 -+ _2 = const 2_u8; // scope 1 at $DIR/cast.rs:+2:13: +2:26 - StorageDead(_3); // scope 1 at $DIR/cast.rs:+2:25: +2:26 - StorageDead(_5); // scope 1 at $DIR/cast.rs:+2:26: +2:27 + StorageLive(_3); // scope 1 at $DIR/cast.rs:+2:13: +2:20 + StorageLive(_4); // scope 1 at $DIR/cast.rs:+2:13: +2:14 +- _4 = _1; // scope 1 at $DIR/cast.rs:+2:13: +2:14 +- _3 = move _4 as u8 (IntToInt); // scope 1 at $DIR/cast.rs:+2:13: +2:20 ++ _4 = const 257_i32; // scope 1 at $DIR/cast.rs:+2:13: +2:14 ++ _3 = const 1_u8; // scope 1 at $DIR/cast.rs:+2:13: +2:20 + StorageDead(_4); // scope 1 at $DIR/cast.rs:+2:19: +2:20 +- _2 = Add(move _3, const 1_u8); // scope 1 at $DIR/cast.rs:+2:13: +2:24 ++ _2 = const 2_u8; // scope 1 at $DIR/cast.rs:+2:13: +2:24 + StorageDead(_3); // scope 1 at $DIR/cast.rs:+2:23: +2:24 _0 = const (); // scope 0 at $DIR/cast.rs:+0:11: +3:2 StorageDead(_2); // scope 1 at $DIR/cast.rs:+3:1: +3:2 StorageDead(_1); // scope 0 at $DIR/cast.rs:+3:1: +3:2 diff --git a/src/test/mir-opt/dataflow-const-prop/cast.rs b/src/test/mir-opt/dataflow-const-prop/cast.rs index 23c360ed874..484403f7f0e 100644 --- a/src/test/mir-opt/dataflow-const-prop/cast.rs +++ b/src/test/mir-opt/dataflow-const-prop/cast.rs @@ -1,8 +1,7 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts // EMIT_MIR cast.main.DataflowConstProp.diff fn main() { let a = 257; - let b = *&a as u8 + 1; + let b = a as u8 + 1; } diff --git a/src/test/mir-opt/dataflow-const-prop/checked.rs b/src/test/mir-opt/dataflow-const-prop/checked.rs index 8c99fc95eb1..0738a4ee53b 100644 --- a/src/test/mir-opt/dataflow-const-prop/checked.rs +++ b/src/test/mir-opt/dataflow-const-prop/checked.rs @@ -1,5 +1,5 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts -Coverflow-checks=on +// compile-flags: -Coverflow-checks=on // EMIT_MIR checked.main.DataflowConstProp.diff #[allow(arithmetic_overflow)] diff --git a/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff index 1a5ded8cc0d..26808c70fbf 100644 --- a/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff +++ b/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff @@ -4,29 +4,27 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/if.rs:+0:11: +0:11 let _1: i32; // in scope 0 at $DIR/if.rs:+1:9: +1:10 - let mut _3: bool; // in scope 0 at $DIR/if.rs:+2:16: +2:24 - let mut _4: i32; // in scope 0 at $DIR/if.rs:+2:16: +2:19 - let mut _5: &i32; // in scope 0 at $DIR/if.rs:+2:17: +2:19 - let mut _7: i32; // in scope 0 at $DIR/if.rs:+3:13: +3:14 - let mut _9: bool; // in scope 0 at $DIR/if.rs:+5:16: +5:24 - let mut _10: i32; // in scope 0 at $DIR/if.rs:+5:16: +5:19 - let mut _11: &i32; // in scope 0 at $DIR/if.rs:+5:17: +5:19 - let mut _12: i32; // in scope 0 at $DIR/if.rs:+5:38: +5:39 - let mut _14: i32; // in scope 0 at $DIR/if.rs:+6:13: +6:14 + let mut _3: bool; // in scope 0 at $DIR/if.rs:+2:16: +2:22 + let mut _4: i32; // in scope 0 at $DIR/if.rs:+2:16: +2:17 + let mut _6: i32; // in scope 0 at $DIR/if.rs:+3:13: +3:14 + let mut _8: bool; // in scope 0 at $DIR/if.rs:+5:16: +5:22 + let mut _9: i32; // in scope 0 at $DIR/if.rs:+5:16: +5:17 + let mut _10: i32; // in scope 0 at $DIR/if.rs:+5:36: +5:37 + let mut _12: i32; // in scope 0 at $DIR/if.rs:+6:13: +6:14 scope 1 { debug a => _1; // in scope 1 at $DIR/if.rs:+1:9: +1:10 let _2: i32; // in scope 1 at $DIR/if.rs:+2:9: +2:10 scope 2 { debug b => _2; // in scope 2 at $DIR/if.rs:+2:9: +2:10 - let _6: i32; // in scope 2 at $DIR/if.rs:+3:9: +3:10 + let _5: i32; // in scope 2 at $DIR/if.rs:+3:9: +3:10 scope 3 { - debug c => _6; // in scope 3 at $DIR/if.rs:+3:9: +3:10 - let _8: i32; // in scope 3 at $DIR/if.rs:+5:9: +5:10 + debug c => _5; // in scope 3 at $DIR/if.rs:+3:9: +3:10 + let _7: i32; // in scope 3 at $DIR/if.rs:+5:9: +5:10 scope 4 { - debug d => _8; // in scope 4 at $DIR/if.rs:+5:9: +5:10 - let _13: i32; // in scope 4 at $DIR/if.rs:+6:9: +6:10 + debug d => _7; // in scope 4 at $DIR/if.rs:+5:9: +5:10 + let _11: i32; // in scope 4 at $DIR/if.rs:+6:9: +6:10 scope 5 { - debug e => _13; // in scope 5 at $DIR/if.rs:+6:9: +6:10 + debug e => _11; // in scope 5 at $DIR/if.rs:+6:9: +6:10 } } } @@ -37,81 +35,75 @@ StorageLive(_1); // scope 0 at $DIR/if.rs:+1:9: +1:10 _1 = const 1_i32; // scope 0 at $DIR/if.rs:+1:13: +1:14 StorageLive(_2); // scope 1 at $DIR/if.rs:+2:9: +2:10 - StorageLive(_3); // scope 1 at $DIR/if.rs:+2:16: +2:24 - StorageLive(_4); // scope 1 at $DIR/if.rs:+2:16: +2:19 - StorageLive(_5); // scope 1 at $DIR/if.rs:+2:17: +2:19 - _5 = &_1; // scope 1 at $DIR/if.rs:+2:17: +2:19 -- _4 = (*_5); // scope 1 at $DIR/if.rs:+2:16: +2:19 -- _3 = Eq(move _4, const 1_i32); // scope 1 at $DIR/if.rs:+2:16: +2:24 -+ _4 = const 1_i32; // scope 1 at $DIR/if.rs:+2:16: +2:19 -+ _3 = const true; // scope 1 at $DIR/if.rs:+2:16: +2:24 - StorageDead(_5); // scope 1 at $DIR/if.rs:+2:23: +2:24 - StorageDead(_4); // scope 1 at $DIR/if.rs:+2:23: +2:24 -- switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:24 -+ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:24 + StorageLive(_3); // scope 1 at $DIR/if.rs:+2:16: +2:22 + StorageLive(_4); // scope 1 at $DIR/if.rs:+2:16: +2:17 +- _4 = _1; // scope 1 at $DIR/if.rs:+2:16: +2:17 +- _3 = Eq(move _4, const 1_i32); // scope 1 at $DIR/if.rs:+2:16: +2:22 ++ _4 = const 1_i32; // scope 1 at $DIR/if.rs:+2:16: +2:17 ++ _3 = const true; // scope 1 at $DIR/if.rs:+2:16: +2:22 + StorageDead(_4); // scope 1 at $DIR/if.rs:+2:21: +2:22 +- switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22 ++ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22 } bb1: { - _2 = const 2_i32; // scope 1 at $DIR/if.rs:+2:27: +2:28 - goto -> bb3; // scope 1 at $DIR/if.rs:+2:13: +2:41 + _2 = const 2_i32; // scope 1 at $DIR/if.rs:+2:25: +2:26 + goto -> bb3; // scope 1 at $DIR/if.rs:+2:13: +2:39 } bb2: { - _2 = const 3_i32; // scope 1 at $DIR/if.rs:+2:38: +2:39 - goto -> bb3; // scope 1 at $DIR/if.rs:+2:13: +2:41 + _2 = const 3_i32; // scope 1 at $DIR/if.rs:+2:36: +2:37 + goto -> bb3; // scope 1 at $DIR/if.rs:+2:13: +2:39 } bb3: { - StorageDead(_3); // scope 1 at $DIR/if.rs:+2:40: +2:41 - StorageLive(_6); // scope 2 at $DIR/if.rs:+3:9: +3:10 - StorageLive(_7); // scope 2 at $DIR/if.rs:+3:13: +3:14 -- _7 = _2; // scope 2 at $DIR/if.rs:+3:13: +3:14 -- _6 = Add(move _7, const 1_i32); // scope 2 at $DIR/if.rs:+3:13: +3:18 -+ _7 = const 2_i32; // scope 2 at $DIR/if.rs:+3:13: +3:14 -+ _6 = const 3_i32; // scope 2 at $DIR/if.rs:+3:13: +3:18 - StorageDead(_7); // scope 2 at $DIR/if.rs:+3:17: +3:18 - StorageLive(_8); // scope 3 at $DIR/if.rs:+5:9: +5:10 - StorageLive(_9); // scope 3 at $DIR/if.rs:+5:16: +5:24 - StorageLive(_10); // scope 3 at $DIR/if.rs:+5:16: +5:19 - StorageLive(_11); // scope 3 at $DIR/if.rs:+5:17: +5:19 - _11 = &_1; // scope 3 at $DIR/if.rs:+5:17: +5:19 -- _10 = (*_11); // scope 3 at $DIR/if.rs:+5:16: +5:19 -- _9 = Eq(move _10, const 1_i32); // scope 3 at $DIR/if.rs:+5:16: +5:24 -+ _10 = const 1_i32; // scope 3 at $DIR/if.rs:+5:16: +5:19 -+ _9 = const true; // scope 3 at $DIR/if.rs:+5:16: +5:24 - StorageDead(_11); // scope 3 at $DIR/if.rs:+5:23: +5:24 - StorageDead(_10); // scope 3 at $DIR/if.rs:+5:23: +5:24 -- switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:24 -+ switchInt(const true) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:24 + StorageDead(_3); // scope 1 at $DIR/if.rs:+2:38: +2:39 + StorageLive(_5); // scope 2 at $DIR/if.rs:+3:9: +3:10 + StorageLive(_6); // scope 2 at $DIR/if.rs:+3:13: +3:14 +- _6 = _2; // scope 2 at $DIR/if.rs:+3:13: +3:14 +- _5 = Add(move _6, const 1_i32); // scope 2 at $DIR/if.rs:+3:13: +3:18 ++ _6 = const 2_i32; // scope 2 at $DIR/if.rs:+3:13: +3:14 ++ _5 = const 3_i32; // scope 2 at $DIR/if.rs:+3:13: +3:18 + StorageDead(_6); // scope 2 at $DIR/if.rs:+3:17: +3:18 + StorageLive(_7); // scope 3 at $DIR/if.rs:+5:9: +5:10 + StorageLive(_8); // scope 3 at $DIR/if.rs:+5:16: +5:22 + StorageLive(_9); // scope 3 at $DIR/if.rs:+5:16: +5:17 +- _9 = _1; // scope 3 at $DIR/if.rs:+5:16: +5:17 +- _8 = Eq(move _9, const 1_i32); // scope 3 at $DIR/if.rs:+5:16: +5:22 ++ _9 = const 1_i32; // scope 3 at $DIR/if.rs:+5:16: +5:17 ++ _8 = const true; // scope 3 at $DIR/if.rs:+5:16: +5:22 + StorageDead(_9); // scope 3 at $DIR/if.rs:+5:21: +5:22 +- switchInt(move _8) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22 ++ switchInt(const true) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22 } bb4: { -- _8 = _1; // scope 3 at $DIR/if.rs:+5:27: +5:28 -+ _8 = const 1_i32; // scope 3 at $DIR/if.rs:+5:27: +5:28 - goto -> bb6; // scope 3 at $DIR/if.rs:+5:13: +5:45 +- _7 = _1; // scope 3 at $DIR/if.rs:+5:25: +5:26 ++ _7 = const 1_i32; // scope 3 at $DIR/if.rs:+5:25: +5:26 + goto -> bb6; // scope 3 at $DIR/if.rs:+5:13: +5:43 } bb5: { - StorageLive(_12); // scope 3 at $DIR/if.rs:+5:38: +5:39 - _12 = _1; // scope 3 at $DIR/if.rs:+5:38: +5:39 - _8 = Add(move _12, const 1_i32); // scope 3 at $DIR/if.rs:+5:38: +5:43 - StorageDead(_12); // scope 3 at $DIR/if.rs:+5:42: +5:43 - goto -> bb6; // scope 3 at $DIR/if.rs:+5:13: +5:45 + StorageLive(_10); // scope 3 at $DIR/if.rs:+5:36: +5:37 + _10 = _1; // scope 3 at $DIR/if.rs:+5:36: +5:37 + _7 = Add(move _10, const 1_i32); // scope 3 at $DIR/if.rs:+5:36: +5:41 + StorageDead(_10); // scope 3 at $DIR/if.rs:+5:40: +5:41 + goto -> bb6; // scope 3 at $DIR/if.rs:+5:13: +5:43 } bb6: { - StorageDead(_9); // scope 3 at $DIR/if.rs:+5:44: +5:45 - StorageLive(_13); // scope 4 at $DIR/if.rs:+6:9: +6:10 - StorageLive(_14); // scope 4 at $DIR/if.rs:+6:13: +6:14 -- _14 = _8; // scope 4 at $DIR/if.rs:+6:13: +6:14 -- _13 = Add(move _14, const 1_i32); // scope 4 at $DIR/if.rs:+6:13: +6:18 -+ _14 = const 1_i32; // scope 4 at $DIR/if.rs:+6:13: +6:14 -+ _13 = const 2_i32; // scope 4 at $DIR/if.rs:+6:13: +6:18 - StorageDead(_14); // scope 4 at $DIR/if.rs:+6:17: +6:18 + StorageDead(_8); // scope 3 at $DIR/if.rs:+5:42: +5:43 + StorageLive(_11); // scope 4 at $DIR/if.rs:+6:9: +6:10 + StorageLive(_12); // scope 4 at $DIR/if.rs:+6:13: +6:14 +- _12 = _7; // scope 4 at $DIR/if.rs:+6:13: +6:14 +- _11 = Add(move _12, const 1_i32); // scope 4 at $DIR/if.rs:+6:13: +6:18 ++ _12 = const 1_i32; // scope 4 at $DIR/if.rs:+6:13: +6:14 ++ _11 = const 2_i32; // scope 4 at $DIR/if.rs:+6:13: +6:18 + StorageDead(_12); // scope 4 at $DIR/if.rs:+6:17: +6:18 _0 = const (); // scope 0 at $DIR/if.rs:+0:11: +7:2 - StorageDead(_13); // scope 4 at $DIR/if.rs:+7:1: +7:2 - StorageDead(_8); // scope 3 at $DIR/if.rs:+7:1: +7:2 - StorageDead(_6); // scope 2 at $DIR/if.rs:+7:1: +7:2 + StorageDead(_11); // scope 4 at $DIR/if.rs:+7:1: +7:2 + StorageDead(_7); // scope 3 at $DIR/if.rs:+7:1: +7:2 + StorageDead(_5); // scope 2 at $DIR/if.rs:+7:1: +7:2 StorageDead(_2); // scope 1 at $DIR/if.rs:+7:1: +7:2 StorageDead(_1); // scope 0 at $DIR/if.rs:+7:1: +7:2 return; // scope 0 at $DIR/if.rs:+7:2: +7:2 diff --git a/src/test/mir-opt/dataflow-const-prop/if.rs b/src/test/mir-opt/dataflow-const-prop/if.rs index cc41da2dc9a..34fc35790c1 100644 --- a/src/test/mir-opt/dataflow-const-prop/if.rs +++ b/src/test/mir-opt/dataflow-const-prop/if.rs @@ -1,12 +1,11 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts // EMIT_MIR if.main.DataflowConstProp.diff fn main() { let a = 1; - let b = if *&a == 1 { 2 } else { 3 }; + let b = if a == 1 { 2 } else { 3 }; let c = b + 1; - let d = if *&a == 1 { a } else { a + 1 }; + let d = if a == 1 { a } else { a + 1 }; let e = d + 1; } diff --git a/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs b/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs index 3f6329dfd1d..2f2d9d0102d 100644 --- a/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs +++ b/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs @@ -1,4 +1,4 @@ -// compile-flags: -Coverflow-checks=off -Zunsound-mir-opts +// compile-flags: -Zunsound-mir-opts // EMIT_MIR inherit_overflow.main.DataflowConstProp.diff fn main() { diff --git a/src/test/mir-opt/dataflow-const-prop/issue_81605.rs b/src/test/mir-opt/dataflow-const-prop/issue_81605.rs index 2829d32c905..d75e2a28bef 100644 --- a/src/test/mir-opt/dataflow-const-prop/issue_81605.rs +++ b/src/test/mir-opt/dataflow-const-prop/issue_81605.rs @@ -1,5 +1,4 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts // EMIT_MIR issue_81605.f.DataflowConstProp.diff fn f() -> usize { diff --git a/src/test/mir-opt/dataflow-const-prop/promoted.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/promoted.main.DataflowConstProp.diff deleted file mode 100644 index 177736d62cd..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/promoted.main.DataflowConstProp.diff +++ /dev/null @@ -1,29 +0,0 @@ -- // MIR for `main` before DataflowConstProp -+ // MIR for `main` after DataflowConstProp - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/promoted.rs:+0:11: +0:11 - let _1: i32; // in scope 0 at $DIR/promoted.rs:+2:9: +2:10 - let mut _2: &i32; // in scope 0 at $DIR/promoted.rs:+2:14: +2:17 - let _3: i32; // in scope 0 at $DIR/promoted.rs:+2:15: +2:17 - let mut _4: &i32; // in scope 0 at $DIR/promoted.rs:+2:14: +2:17 - scope 1 { - debug a => _1; // in scope 1 at $DIR/promoted.rs:+2:9: +2:10 - } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/promoted.rs:+2:9: +2:10 - StorageLive(_2); // scope 0 at $DIR/promoted.rs:+2:14: +2:17 - _4 = const _; // scope 0 at $DIR/promoted.rs:+2:14: +2:17 - // mir::Constant - // + span: $DIR/promoted.rs:7:14: 7:17 - // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) } - _2 = &(*_4); // scope 0 at $DIR/promoted.rs:+2:14: +2:17 - _1 = (*_2); // scope 0 at $DIR/promoted.rs:+2:13: +2:17 - StorageDead(_2); // scope 0 at $DIR/promoted.rs:+2:17: +2:18 - _0 = const (); // scope 0 at $DIR/promoted.rs:+0:11: +3:2 - StorageDead(_1); // scope 0 at $DIR/promoted.rs:+3:1: +3:2 - return; // scope 0 at $DIR/promoted.rs:+3:2: +3:2 - } - } - diff --git a/src/test/mir-opt/dataflow-const-prop/promoted.rs b/src/test/mir-opt/dataflow-const-prop/promoted.rs deleted file mode 100644 index e5ca2f5b607..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/promoted.rs +++ /dev/null @@ -1,8 +0,0 @@ -// unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts - -// EMIT_MIR promoted.main.DataflowConstProp.diff -fn main() { - // This does not work because `&42` gets promoted. - let a = *&42; -} diff --git a/src/test/mir-opt/dataflow-const-prop/ref.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/ref.main.DataflowConstProp.diff deleted file mode 100644 index f500c827786..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/ref.main.DataflowConstProp.diff +++ /dev/null @@ -1,89 +0,0 @@ -- // MIR for `main` before DataflowConstProp -+ // MIR for `main` after DataflowConstProp - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/ref.rs:+0:11: +0:11 - let _1: i32; // in scope 0 at $DIR/ref.rs:+1:9: +1:10 - let mut _4: bool; // in scope 0 at $DIR/ref.rs:+3:16: +3:43 - let mut _5: u32; // in scope 0 at $DIR/ref.rs:+3:16: +3:38 - let mut _6: u32; // in scope 0 at $DIR/ref.rs:+3:16: +3:34 - let mut _7: bool; // in scope 0 at $DIR/ref.rs:+3:16: +3:38 - let _8: &i32; // in scope 0 at $DIR/ref.rs:+3:58: +3:60 - let mut _10: i32; // in scope 0 at $DIR/ref.rs:+4:13: +4:15 - scope 1 { - debug a => _1; // in scope 1 at $DIR/ref.rs:+1:9: +1:10 - let _2: i32; // in scope 1 at $DIR/ref.rs:+2:9: +2:10 - scope 2 { - debug b => _2; // in scope 2 at $DIR/ref.rs:+2:9: +2:10 - let _3: &i32; // in scope 2 at $DIR/ref.rs:+3:9: +3:10 - scope 3 { - debug c => _3; // in scope 3 at $DIR/ref.rs:+3:9: +3:10 - let _9: i32; // in scope 3 at $DIR/ref.rs:+4:9: +4:10 - scope 4 { - debug d => _9; // in scope 4 at $DIR/ref.rs:+4:9: +4:10 - } - } - } - } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/ref.rs:+1:9: +1:10 - _1 = const 0_i32; // scope 0 at $DIR/ref.rs:+1:13: +1:14 - StorageLive(_2); // scope 1 at $DIR/ref.rs:+2:9: +2:10 - _2 = const 0_i32; // scope 1 at $DIR/ref.rs:+2:13: +2:14 - StorageLive(_3); // scope 2 at $DIR/ref.rs:+3:9: +3:10 - StorageLive(_4); // scope 2 at $DIR/ref.rs:+3:16: +3:43 - StorageLive(_5); // scope 2 at $DIR/ref.rs:+3:16: +3:38 - StorageLive(_6); // scope 2 at $DIR/ref.rs:+3:16: +3:34 - _6 = id() -> bb1; // scope 2 at $DIR/ref.rs:+3:16: +3:34 - // mir::Constant - // + span: $DIR/ref.rs:8:16: 8:32 - // + literal: Const { ty: fn() -> u32 {id}, val: Value(<ZST>) } - } - - bb1: { -- _7 = Eq(const 2_u32, const 0_u32); // scope 2 at $DIR/ref.rs:+3:16: +3:38 -- assert(!move _7, "attempt to calculate the remainder of `{}` with a divisor of zero", _6) -> bb2; // scope 2 at $DIR/ref.rs:+3:16: +3:38 -+ _7 = const false; // scope 2 at $DIR/ref.rs:+3:16: +3:38 -+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _6) -> bb2; // scope 2 at $DIR/ref.rs:+3:16: +3:38 - } - - bb2: { - _5 = Rem(move _6, const 2_u32); // scope 2 at $DIR/ref.rs:+3:16: +3:38 - StorageDead(_6); // scope 2 at $DIR/ref.rs:+3:37: +3:38 - _4 = Eq(move _5, const 0_u32); // scope 2 at $DIR/ref.rs:+3:16: +3:43 - StorageDead(_5); // scope 2 at $DIR/ref.rs:+3:42: +3:43 - switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/ref.rs:+3:16: +3:43 - } - - bb3: { - _3 = &_1; // scope 2 at $DIR/ref.rs:+3:46: +3:48 - goto -> bb5; // scope 2 at $DIR/ref.rs:+3:13: +3:62 - } - - bb4: { - StorageLive(_8); // scope 2 at $DIR/ref.rs:+3:58: +3:60 - _8 = &_2; // scope 2 at $DIR/ref.rs:+3:58: +3:60 - _3 = &(*_8); // scope 2 at $DIR/ref.rs:+3:58: +3:60 - StorageDead(_8); // scope 2 at $DIR/ref.rs:+3:61: +3:62 - goto -> bb5; // scope 2 at $DIR/ref.rs:+3:13: +3:62 - } - - bb5: { - StorageDead(_4); // scope 2 at $DIR/ref.rs:+3:61: +3:62 - StorageLive(_9); // scope 3 at $DIR/ref.rs:+4:9: +4:10 - StorageLive(_10); // scope 3 at $DIR/ref.rs:+4:13: +4:15 -- _10 = (*_3); // scope 3 at $DIR/ref.rs:+4:13: +4:15 -- _9 = Add(move _10, const 1_i32); // scope 3 at $DIR/ref.rs:+4:13: +4:19 -+ _10 = const 0_i32; // scope 3 at $DIR/ref.rs:+4:13: +4:15 -+ _9 = const 1_i32; // scope 3 at $DIR/ref.rs:+4:13: +4:19 - StorageDead(_10); // scope 3 at $DIR/ref.rs:+4:18: +4:19 - _0 = const (); // scope 0 at $DIR/ref.rs:+0:11: +5:2 - StorageDead(_9); // scope 3 at $DIR/ref.rs:+5:1: +5:2 - StorageDead(_3); // scope 2 at $DIR/ref.rs:+5:1: +5:2 - StorageDead(_2); // scope 1 at $DIR/ref.rs:+5:1: +5:2 - StorageDead(_1); // scope 0 at $DIR/ref.rs:+5:1: +5:2 - return; // scope 0 at $DIR/ref.rs:+5:2: +5:2 - } - } - diff --git a/src/test/mir-opt/dataflow-const-prop/ref.rs b/src/test/mir-opt/dataflow-const-prop/ref.rs deleted file mode 100644 index 6c0e3063b0a..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/ref.rs +++ /dev/null @@ -1,10 +0,0 @@ -// unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts - -// EMIT_MIR ref.main.DataflowConstProp.diff -fn main() { - let a = 0; - let b = 0; - let c = if std::process::id() % 2 == 0 { &a } else { &b }; - let d = *c + 1; -} diff --git a/src/test/mir-opt/dataflow-const-prop/ref_mut.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/ref_mut.main.DataflowConstProp.diff deleted file mode 100644 index 746082eee53..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/ref_mut.main.DataflowConstProp.diff +++ /dev/null @@ -1,77 +0,0 @@ -- // MIR for `main` before DataflowConstProp -+ // MIR for `main` after DataflowConstProp - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/ref_mut.rs:+0:11: +0:11 - let mut _1: i32; // in scope 0 at $DIR/ref_mut.rs:+1:9: +1:14 - let mut _7: &i32; // in scope 0 at $DIR/ref_mut.rs:+9:10: +9:12 - let _8: &i32; // in scope 0 at $DIR/ref_mut.rs:+9:10: +9:12 - let _9: i32; // in scope 0 at $DIR/ref_mut.rs:+9:11: +9:12 - scope 1 { - debug a => _1; // in scope 1 at $DIR/ref_mut.rs:+1:9: +1:14 - let _2: &mut i32; // in scope 1 at $DIR/ref_mut.rs:+2:9: +2:10 - scope 2 { - debug b => _2; // in scope 2 at $DIR/ref_mut.rs:+2:9: +2:10 - let _3: i32; // in scope 2 at $DIR/ref_mut.rs:+4:9: +4:10 - scope 3 { - debug c => _3; // in scope 3 at $DIR/ref_mut.rs:+4:9: +4:10 - let _4: i32; // in scope 3 at $DIR/ref_mut.rs:+6:9: +6:10 - scope 4 { - debug d => _4; // in scope 4 at $DIR/ref_mut.rs:+6:9: +6:10 - let mut _5: &i32; // in scope 4 at $DIR/ref_mut.rs:+7:9: +7:14 - scope 5 { - debug e => _5; // in scope 5 at $DIR/ref_mut.rs:+7:9: +7:14 - let _6: &mut &i32; // in scope 5 at $DIR/ref_mut.rs:+8:9: +8:10 - scope 6 { - debug f => _6; // in scope 6 at $DIR/ref_mut.rs:+8:9: +8:10 - let _10: i32; // in scope 6 at $DIR/ref_mut.rs:+10:9: +10:10 - let mut _11: &i32; // in scope 6 at $DIR/ref_mut.rs:+9:10: +9:12 - scope 7 { - debug g => _10; // in scope 7 at $DIR/ref_mut.rs:+10:9: +10:10 - } - } - } - } - } - } - } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/ref_mut.rs:+1:9: +1:14 - _1 = const 0_i32; // scope 0 at $DIR/ref_mut.rs:+1:17: +1:18 - StorageLive(_2); // scope 1 at $DIR/ref_mut.rs:+2:9: +2:10 - _2 = &mut _1; // scope 1 at $DIR/ref_mut.rs:+2:13: +2:19 - (*_2) = const 1_i32; // scope 2 at $DIR/ref_mut.rs:+3:5: +3:11 - StorageLive(_3); // scope 2 at $DIR/ref_mut.rs:+4:9: +4:10 - _3 = _1; // scope 2 at $DIR/ref_mut.rs:+4:13: +4:14 - StorageLive(_4); // scope 3 at $DIR/ref_mut.rs:+6:9: +6:10 - _4 = const 0_i32; // scope 3 at $DIR/ref_mut.rs:+6:13: +6:14 - StorageLive(_5); // scope 4 at $DIR/ref_mut.rs:+7:9: +7:14 - _5 = &_4; // scope 4 at $DIR/ref_mut.rs:+7:17: +7:19 - StorageLive(_6); // scope 5 at $DIR/ref_mut.rs:+8:9: +8:10 - _6 = &mut _5; // scope 5 at $DIR/ref_mut.rs:+8:13: +8:19 - StorageLive(_7); // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12 - StorageLive(_8); // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12 - _11 = const _; // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12 - // mir::Constant - // + span: $DIR/ref_mut.rs:14:10: 14:12 - // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) } - _8 = &(*_11); // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12 - _7 = &(*_8); // scope 6 at $DIR/ref_mut.rs:+9:10: +9:12 - (*_6) = move _7; // scope 6 at $DIR/ref_mut.rs:+9:5: +9:12 - StorageDead(_7); // scope 6 at $DIR/ref_mut.rs:+9:11: +9:12 - StorageDead(_8); // scope 6 at $DIR/ref_mut.rs:+9:12: +9:13 - StorageLive(_10); // scope 6 at $DIR/ref_mut.rs:+10:9: +10:10 - _10 = (*_5); // scope 6 at $DIR/ref_mut.rs:+10:13: +10:15 - _0 = const (); // scope 0 at $DIR/ref_mut.rs:+0:11: +11:2 - StorageDead(_10); // scope 6 at $DIR/ref_mut.rs:+11:1: +11:2 - StorageDead(_6); // scope 5 at $DIR/ref_mut.rs:+11:1: +11:2 - StorageDead(_5); // scope 4 at $DIR/ref_mut.rs:+11:1: +11:2 - StorageDead(_4); // scope 3 at $DIR/ref_mut.rs:+11:1: +11:2 - StorageDead(_3); // scope 2 at $DIR/ref_mut.rs:+11:1: +11:2 - StorageDead(_2); // scope 1 at $DIR/ref_mut.rs:+11:1: +11:2 - StorageDead(_1); // scope 0 at $DIR/ref_mut.rs:+11:1: +11:2 - return; // scope 0 at $DIR/ref_mut.rs:+11:2: +11:2 - } - } - diff --git a/src/test/mir-opt/dataflow-const-prop/ref_mut.rs b/src/test/mir-opt/dataflow-const-prop/ref_mut.rs deleted file mode 100644 index 57283439516..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/ref_mut.rs +++ /dev/null @@ -1,16 +0,0 @@ -// unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts - -// EMIT_MIR ref_mut.main.DataflowConstProp.diff -fn main() { - let mut a = 0; - let b = &mut a; - *b = 1; - let c = a; - - let d = 0; - let mut e = &d; - let f = &mut e; - *f = &1; - let g = *e; -} diff --git a/src/test/mir-opt/dataflow-const-prop/ref_with_sb.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/ref_with_sb.main.DataflowConstProp.diff deleted file mode 100644 index 81aa0a1a93d..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/ref_with_sb.main.DataflowConstProp.diff +++ /dev/null @@ -1,56 +0,0 @@ -- // MIR for `main` before DataflowConstProp -+ // MIR for `main` after DataflowConstProp - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/ref_with_sb.rs:+0:11: +0:11 - let mut _1: i32; // in scope 0 at $DIR/ref_with_sb.rs:+1:9: +1:14 - let _2: (); // in scope 0 at $DIR/ref_with_sb.rs:+2:5: +2:15 - let mut _3: &i32; // in scope 0 at $DIR/ref_with_sb.rs:+2:12: +2:14 - let _4: &i32; // in scope 0 at $DIR/ref_with_sb.rs:+2:12: +2:14 - let _5: (); // in scope 0 at $DIR/ref_with_sb.rs:+4:5: +4:20 - scope 1 { - debug a => _1; // in scope 1 at $DIR/ref_with_sb.rs:+1:9: +1:14 - let _6: i32; // in scope 1 at $DIR/ref_with_sb.rs:+7:9: +7:10 - scope 2 { - debug b => _6; // in scope 2 at $DIR/ref_with_sb.rs:+7:9: +7:10 - } - } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/ref_with_sb.rs:+1:9: +1:14 - _1 = const 0_i32; // scope 0 at $DIR/ref_with_sb.rs:+1:17: +1:18 - StorageLive(_2); // scope 1 at $DIR/ref_with_sb.rs:+2:5: +2:15 - StorageLive(_3); // scope 1 at $DIR/ref_with_sb.rs:+2:12: +2:14 - StorageLive(_4); // scope 1 at $DIR/ref_with_sb.rs:+2:12: +2:14 - _4 = &_1; // scope 1 at $DIR/ref_with_sb.rs:+2:12: +2:14 - _3 = &(*_4); // scope 1 at $DIR/ref_with_sb.rs:+2:12: +2:14 - _2 = escape::<i32>(move _3) -> bb1; // scope 1 at $DIR/ref_with_sb.rs:+2:5: +2:15 - // mir::Constant - // + span: $DIR/ref_with_sb.rs:13:5: 13:11 - // + literal: Const { ty: for<'a> fn(&'a i32) {escape::<i32>}, val: Value(<ZST>) } - } - - bb1: { - StorageDead(_3); // scope 1 at $DIR/ref_with_sb.rs:+2:14: +2:15 - StorageDead(_4); // scope 1 at $DIR/ref_with_sb.rs:+2:15: +2:16 - StorageDead(_2); // scope 1 at $DIR/ref_with_sb.rs:+2:15: +2:16 - _1 = const 1_i32; // scope 1 at $DIR/ref_with_sb.rs:+3:5: +3:10 - StorageLive(_5); // scope 1 at $DIR/ref_with_sb.rs:+4:5: +4:20 - _5 = some_function() -> bb2; // scope 1 at $DIR/ref_with_sb.rs:+4:5: +4:20 - // mir::Constant - // + span: $DIR/ref_with_sb.rs:15:5: 15:18 - // + literal: Const { ty: fn() {some_function}, val: Value(<ZST>) } - } - - bb2: { - StorageDead(_5); // scope 1 at $DIR/ref_with_sb.rs:+4:20: +4:21 - StorageLive(_6); // scope 1 at $DIR/ref_with_sb.rs:+7:9: +7:10 -- _6 = _1; // scope 1 at $DIR/ref_with_sb.rs:+7:13: +7:14 -+ _6 = const 1_i32; // scope 1 at $DIR/ref_with_sb.rs:+7:13: +7:14 - _0 = const (); // scope 0 at $DIR/ref_with_sb.rs:+0:11: +8:2 - StorageDead(_6); // scope 1 at $DIR/ref_with_sb.rs:+8:1: +8:2 - StorageDead(_1); // scope 0 at $DIR/ref_with_sb.rs:+8:1: +8:2 - return; // scope 0 at $DIR/ref_with_sb.rs:+8:2: +8:2 - } - } - diff --git a/src/test/mir-opt/dataflow-const-prop/ref_with_sb.rs b/src/test/mir-opt/dataflow-const-prop/ref_with_sb.rs deleted file mode 100644 index 060aa6ab794..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/ref_with_sb.rs +++ /dev/null @@ -1,19 +0,0 @@ -// unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts - -#[inline(never)] -fn escape<T>(x: &T) {} - -#[inline(never)] -fn some_function() {} - -// EMIT_MIR ref_with_sb.main.DataflowConstProp.diff -fn main() { - let mut a = 0; - escape(&a); - a = 1; - some_function(); - // With `-Zunsound-mir-opt`, this should be propagated - // (because we assume Stacked Borrows). - let b = a; -} diff --git a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff index dc6a6a8a759..158f187f157 100644 --- a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff +++ b/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff @@ -10,9 +10,9 @@ let _5: (); // in scope 0 at $DIR/ref_without_sb.rs:+4:5: +4:20 scope 1 { debug a => _1; // in scope 1 at $DIR/ref_without_sb.rs:+1:9: +1:14 - let _6: i32; // in scope 1 at $DIR/ref_without_sb.rs:+7:9: +7:10 + let _6: i32; // in scope 1 at $DIR/ref_without_sb.rs:+6:9: +6:10 scope 2 { - debug b => _6; // in scope 2 at $DIR/ref_without_sb.rs:+7:9: +7:10 + debug b => _6; // in scope 2 at $DIR/ref_without_sb.rs:+6:9: +6:10 } } @@ -44,12 +44,12 @@ bb2: { StorageDead(_5); // scope 1 at $DIR/ref_without_sb.rs:+4:20: +4:21 - StorageLive(_6); // scope 1 at $DIR/ref_without_sb.rs:+7:9: +7:10 - _6 = _1; // scope 1 at $DIR/ref_without_sb.rs:+7:13: +7:14 - _0 = const (); // scope 0 at $DIR/ref_without_sb.rs:+0:11: +8:2 - StorageDead(_6); // scope 1 at $DIR/ref_without_sb.rs:+8:1: +8:2 - StorageDead(_1); // scope 0 at $DIR/ref_without_sb.rs:+8:1: +8:2 - return; // scope 0 at $DIR/ref_without_sb.rs:+8:2: +8:2 + StorageLive(_6); // scope 1 at $DIR/ref_without_sb.rs:+6:9: +6:10 + _6 = _1; // scope 1 at $DIR/ref_without_sb.rs:+6:13: +6:14 + _0 = const (); // scope 0 at $DIR/ref_without_sb.rs:+0:11: +7:2 + StorageDead(_6); // scope 1 at $DIR/ref_without_sb.rs:+7:1: +7:2 + StorageDead(_1); // scope 0 at $DIR/ref_without_sb.rs:+7:1: +7:2 + return; // scope 0 at $DIR/ref_without_sb.rs:+7:2: +7:2 } } diff --git a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs b/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs index 4789eb69cda..2fd480b0968 100644 --- a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs +++ b/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs @@ -12,7 +12,6 @@ fn main() { escape(&a); a = 1; some_function(); - // Without `-Zunsound-mir-opt`, this should not be propagated - // (because we do not assume Stacked Borrows). + // This should currently not be propagated. let b = a; } diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff index dd1242d7cac..df08eff94cb 100644 --- a/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff +++ b/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff @@ -20,16 +20,12 @@ StorageLive(_1); // scope 0 at $DIR/self_assign.rs:+1:9: +1:14 _1 = const 0_i32; // scope 0 at $DIR/self_assign.rs:+1:17: +1:18 StorageLive(_2); // scope 1 at $DIR/self_assign.rs:+2:9: +2:10 -- _2 = _1; // scope 1 at $DIR/self_assign.rs:+2:9: +2:10 -- _1 = Add(move _2, const 1_i32); // scope 1 at $DIR/self_assign.rs:+2:5: +2:14 -+ _2 = const 0_i32; // scope 1 at $DIR/self_assign.rs:+2:9: +2:10 -+ _1 = const 1_i32; // scope 1 at $DIR/self_assign.rs:+2:5: +2:14 + _2 = _1; // scope 1 at $DIR/self_assign.rs:+2:9: +2:10 + _1 = Add(move _2, const 1_i32); // scope 1 at $DIR/self_assign.rs:+2:5: +2:14 StorageDead(_2); // scope 1 at $DIR/self_assign.rs:+2:13: +2:14 StorageLive(_3); // scope 1 at $DIR/self_assign.rs:+3:9: +3:10 -- _3 = _1; // scope 1 at $DIR/self_assign.rs:+3:9: +3:10 -- _1 = move _3; // scope 1 at $DIR/self_assign.rs:+3:5: +3:10 -+ _3 = const 1_i32; // scope 1 at $DIR/self_assign.rs:+3:9: +3:10 -+ _1 = const 1_i32; // scope 1 at $DIR/self_assign.rs:+3:5: +3:10 + _3 = _1; // scope 1 at $DIR/self_assign.rs:+3:9: +3:10 + _1 = move _3; // scope 1 at $DIR/self_assign.rs:+3:5: +3:10 StorageDead(_3); // scope 1 at $DIR/self_assign.rs:+3:9: +3:10 StorageLive(_4); // scope 1 at $DIR/self_assign.rs:+5:9: +5:14 _4 = &_1; // scope 1 at $DIR/self_assign.rs:+5:17: +5:19 @@ -38,10 +34,8 @@ _4 = move _5; // scope 2 at $DIR/self_assign.rs:+6:5: +6:10 StorageDead(_5); // scope 2 at $DIR/self_assign.rs:+6:9: +6:10 StorageLive(_6); // scope 2 at $DIR/self_assign.rs:+7:9: +7:11 -- _6 = (*_4); // scope 2 at $DIR/self_assign.rs:+7:9: +7:11 -- _1 = move _6; // scope 2 at $DIR/self_assign.rs:+7:5: +7:11 -+ _6 = const 1_i32; // scope 2 at $DIR/self_assign.rs:+7:9: +7:11 -+ _1 = const 1_i32; // scope 2 at $DIR/self_assign.rs:+7:5: +7:11 + _6 = (*_4); // scope 2 at $DIR/self_assign.rs:+7:9: +7:11 + _1 = move _6; // scope 2 at $DIR/self_assign.rs:+7:5: +7:11 StorageDead(_6); // scope 2 at $DIR/self_assign.rs:+7:10: +7:11 _0 = const (); // scope 0 at $DIR/self_assign.rs:+0:11: +8:2 StorageDead(_4); // scope 1 at $DIR/self_assign.rs:+8:1: +8:2 diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign.rs b/src/test/mir-opt/dataflow-const-prop/self_assign.rs index e8a62a83960..8de2195f93b 100644 --- a/src/test/mir-opt/dataflow-const-prop/self_assign.rs +++ b/src/test/mir-opt/dataflow-const-prop/self_assign.rs @@ -1,5 +1,4 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts // EMIT_MIR self_assign.main.DataflowConstProp.diff fn main() { diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs b/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs index be2a4f04f62..e3282762459 100644 --- a/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs +++ b/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs @@ -1,5 +1,4 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts // EMIT_MIR self_assign_add.main.DataflowConstProp.diff fn main() { diff --git a/src/test/mir-opt/dataflow-const-prop/static_ref.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/static_ref.main.DataflowConstProp.diff deleted file mode 100644 index 2d0d70b6a74..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/static_ref.main.DataflowConstProp.diff +++ /dev/null @@ -1,53 +0,0 @@ -- // MIR for `main` before DataflowConstProp -+ // MIR for `main` after DataflowConstProp - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/static_ref.rs:+0:11: +0:11 - let _1: i32; // in scope 0 at $DIR/static_ref.rs:+3:9: +3:10 - let mut _3: &i32; // in scope 0 at $DIR/static_ref.rs:+5:9: +5:11 - let _4: &i32; // in scope 0 at $DIR/static_ref.rs:+5:9: +5:11 - let _5: &i32; // in scope 0 at $DIR/static_ref.rs:+5:10: +5:11 - scope 1 { - debug x => _1; // in scope 1 at $DIR/static_ref.rs:+3:9: +3:10 - let mut _2: &i32; // in scope 1 at $DIR/static_ref.rs:+4:9: +4:14 - scope 2 { - debug r => _2; // in scope 2 at $DIR/static_ref.rs:+4:9: +4:14 - let _6: i32; // in scope 2 at $DIR/static_ref.rs:+6:9: +6:10 - scope 3 { - debug y => _6; // in scope 3 at $DIR/static_ref.rs:+6:9: +6:10 - } - } - } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/static_ref.rs:+3:9: +3:10 - _1 = const 0_i32; // scope 0 at $DIR/static_ref.rs:+3:13: +3:14 - StorageLive(_2); // scope 1 at $DIR/static_ref.rs:+4:9: +4:14 - _2 = &_1; // scope 1 at $DIR/static_ref.rs:+4:17: +4:19 - StorageLive(_3); // scope 2 at $DIR/static_ref.rs:+5:9: +5:11 - StorageLive(_4); // scope 2 at $DIR/static_ref.rs:+5:9: +5:11 - StorageLive(_5); // scope 2 at $DIR/static_ref.rs:+5:10: +5:11 - _5 = const {alloc1: &i32}; // scope 2 at $DIR/static_ref.rs:+5:10: +5:11 - // mir::Constant - // + span: $DIR/static_ref.rs:10:10: 10:11 - // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) } - _4 = &(*_5); // scope 2 at $DIR/static_ref.rs:+5:9: +5:11 - _3 = &(*_4); // scope 2 at $DIR/static_ref.rs:+5:9: +5:11 - _2 = move _3; // scope 2 at $DIR/static_ref.rs:+5:5: +5:11 - StorageDead(_3); // scope 2 at $DIR/static_ref.rs:+5:10: +5:11 - StorageDead(_5); // scope 2 at $DIR/static_ref.rs:+5:11: +5:12 - StorageDead(_4); // scope 2 at $DIR/static_ref.rs:+5:11: +5:12 - StorageLive(_6); // scope 2 at $DIR/static_ref.rs:+6:9: +6:10 - _6 = (*_2); // scope 2 at $DIR/static_ref.rs:+6:13: +6:15 - _0 = const (); // scope 0 at $DIR/static_ref.rs:+0:11: +7:2 - StorageDead(_6); // scope 2 at $DIR/static_ref.rs:+7:1: +7:2 - StorageDead(_2); // scope 1 at $DIR/static_ref.rs:+7:1: +7:2 - StorageDead(_1); // scope 0 at $DIR/static_ref.rs:+7:1: +7:2 - return; // scope 0 at $DIR/static_ref.rs:+7:2: +7:2 - } - } - - alloc1 (static: P, size: 4, align: 4) { - 05 00 00 00 │ .... - } - diff --git a/src/test/mir-opt/dataflow-const-prop/static_ref.rs b/src/test/mir-opt/dataflow-const-prop/static_ref.rs deleted file mode 100644 index 90f20ae51ce..00000000000 --- a/src/test/mir-opt/dataflow-const-prop/static_ref.rs +++ /dev/null @@ -1,12 +0,0 @@ -// unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts - -// EMIT_MIR static_ref.main.DataflowConstProp.diff -fn main() { - // Currently, this will not propagate. - static P: i32 = 5; - let x = 0; - let mut r = &x; - r = &P; - let y = *r; -} diff --git a/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff index d1b8895901e..8018400e798 100644 --- a/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff +++ b/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff @@ -4,9 +4,9 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/terminator.rs:+0:11: +0:11 let _1: i32; // in scope 0 at $DIR/terminator.rs:+1:9: +1:10 - let _2: (); // in scope 0 at $DIR/terminator.rs:+2:5: +2:15 - let mut _3: i32; // in scope 0 at $DIR/terminator.rs:+2:9: +2:14 - let mut _4: i32; // in scope 0 at $DIR/terminator.rs:+2:9: +2:10 + let _2: (); // in scope 0 at $DIR/terminator.rs:+3:5: +3:15 + let mut _3: i32; // in scope 0 at $DIR/terminator.rs:+3:9: +3:14 + let mut _4: i32; // in scope 0 at $DIR/terminator.rs:+3:9: +3:10 scope 1 { debug a => _1; // in scope 1 at $DIR/terminator.rs:+1:9: +1:10 } @@ -14,27 +14,27 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/terminator.rs:+1:9: +1:10 _1 = const 1_i32; // scope 0 at $DIR/terminator.rs:+1:13: +1:14 - StorageLive(_2); // scope 1 at $DIR/terminator.rs:+2:5: +2:15 - StorageLive(_3); // scope 1 at $DIR/terminator.rs:+2:9: +2:14 - StorageLive(_4); // scope 1 at $DIR/terminator.rs:+2:9: +2:10 -- _4 = _1; // scope 1 at $DIR/terminator.rs:+2:9: +2:10 -- _3 = Add(move _4, const 1_i32); // scope 1 at $DIR/terminator.rs:+2:9: +2:14 -+ _4 = const 1_i32; // scope 1 at $DIR/terminator.rs:+2:9: +2:10 -+ _3 = const 2_i32; // scope 1 at $DIR/terminator.rs:+2:9: +2:14 - StorageDead(_4); // scope 1 at $DIR/terminator.rs:+2:13: +2:14 -- _2 = foo(move _3) -> bb1; // scope 1 at $DIR/terminator.rs:+2:5: +2:15 -+ _2 = foo(const 2_i32) -> bb1; // scope 1 at $DIR/terminator.rs:+2:5: +2:15 + StorageLive(_2); // scope 1 at $DIR/terminator.rs:+3:5: +3:15 + StorageLive(_3); // scope 1 at $DIR/terminator.rs:+3:9: +3:14 + StorageLive(_4); // scope 1 at $DIR/terminator.rs:+3:9: +3:10 +- _4 = _1; // scope 1 at $DIR/terminator.rs:+3:9: +3:10 +- _3 = Add(move _4, const 1_i32); // scope 1 at $DIR/terminator.rs:+3:9: +3:14 ++ _4 = const 1_i32; // scope 1 at $DIR/terminator.rs:+3:9: +3:10 ++ _3 = const 2_i32; // scope 1 at $DIR/terminator.rs:+3:9: +3:14 + StorageDead(_4); // scope 1 at $DIR/terminator.rs:+3:13: +3:14 +- _2 = foo(move _3) -> bb1; // scope 1 at $DIR/terminator.rs:+3:5: +3:15 ++ _2 = foo(const 2_i32) -> bb1; // scope 1 at $DIR/terminator.rs:+3:5: +3:15 // mir::Constant // + span: $DIR/terminator.rs:9:5: 9:8 // + literal: Const { ty: fn(i32) {foo}, val: Value(<ZST>) } } bb1: { - StorageDead(_3); // scope 1 at $DIR/terminator.rs:+2:14: +2:15 - StorageDead(_2); // scope 1 at $DIR/terminator.rs:+2:15: +2:16 - _0 = const (); // scope 0 at $DIR/terminator.rs:+0:11: +3:2 - StorageDead(_1); // scope 0 at $DIR/terminator.rs:+3:1: +3:2 - return; // scope 0 at $DIR/terminator.rs:+3:2: +3:2 + StorageDead(_3); // scope 1 at $DIR/terminator.rs:+3:14: +3:15 + StorageDead(_2); // scope 1 at $DIR/terminator.rs:+3:15: +3:16 + _0 = const (); // scope 0 at $DIR/terminator.rs:+0:11: +4:2 + StorageDead(_1); // scope 0 at $DIR/terminator.rs:+4:1: +4:2 + return; // scope 0 at $DIR/terminator.rs:+4:2: +4:2 } } diff --git a/src/test/mir-opt/dataflow-const-prop/terminator.rs b/src/test/mir-opt/dataflow-const-prop/terminator.rs index 7d8bb58f684..d151f666a2d 100644 --- a/src/test/mir-opt/dataflow-const-prop/terminator.rs +++ b/src/test/mir-opt/dataflow-const-prop/terminator.rs @@ -1,10 +1,10 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts fn foo(n: i32) {} // EMIT_MIR terminator.main.DataflowConstProp.diff fn main() { let a = 1; + // Checks that we propagate into terminators. foo(a + 1); } diff --git a/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff b/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff index 7fb1c8b7caf..e028def00a1 100644 --- a/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff +++ b/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff @@ -4,26 +4,21 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/tuple.rs:+0:11: +0:11 let mut _1: (i32, i32); // in scope 0 at $DIR/tuple.rs:+1:9: +1:14 - let mut _4: i32; // in scope 0 at $DIR/tuple.rs:+3:13: +3:22 - let mut _5: i32; // in scope 0 at $DIR/tuple.rs:+3:13: +3:16 - let mut _6: i32; // in scope 0 at $DIR/tuple.rs:+3:19: +3:22 - let mut _7: &(i32, i32); // in scope 0 at $DIR/tuple.rs:+5:9: +5:11 - let _8: &(i32, i32); // in scope 0 at $DIR/tuple.rs:+5:9: +5:11 - let mut _10: i32; // in scope 0 at $DIR/tuple.rs:+6:13: +6:22 - let mut _11: i32; // in scope 0 at $DIR/tuple.rs:+6:13: +6:16 - let mut _12: i32; // in scope 0 at $DIR/tuple.rs:+6:19: +6:22 + let mut _3: i32; // in scope 0 at $DIR/tuple.rs:+2:13: +2:22 + let mut _4: i32; // in scope 0 at $DIR/tuple.rs:+2:13: +2:16 + let mut _5: i32; // in scope 0 at $DIR/tuple.rs:+2:19: +2:22 + let mut _7: i32; // in scope 0 at $DIR/tuple.rs:+4:13: +4:22 + let mut _8: i32; // in scope 0 at $DIR/tuple.rs:+4:13: +4:16 + let mut _9: i32; // in scope 0 at $DIR/tuple.rs:+4:19: +4:22 + let mut _10: i32; // in scope 0 at $DIR/tuple.rs:+4:25: +4:26 scope 1 { debug a => _1; // in scope 1 at $DIR/tuple.rs:+1:9: +1:14 - let mut _2: &(i32, i32); // in scope 1 at $DIR/tuple.rs:+2:9: +2:14 + let _2: i32; // in scope 1 at $DIR/tuple.rs:+2:9: +2:10 scope 2 { - debug b => _2; // in scope 2 at $DIR/tuple.rs:+2:9: +2:14 - let _3: i32; // in scope 2 at $DIR/tuple.rs:+3:9: +3:10 + debug b => _2; // in scope 2 at $DIR/tuple.rs:+2:9: +2:10 + let _6: i32; // in scope 2 at $DIR/tuple.rs:+4:9: +4:10 scope 3 { - debug c => _3; // in scope 3 at $DIR/tuple.rs:+3:9: +3:10 - let _9: i32; // in scope 3 at $DIR/tuple.rs:+6:9: +6:10 - scope 4 { - debug d => _9; // in scope 4 at $DIR/tuple.rs:+6:9: +6:10 - } + debug c => _6; // in scope 3 at $DIR/tuple.rs:+4:9: +4:10 } } } @@ -33,54 +28,48 @@ Deinit(_1); // scope 0 at $DIR/tuple.rs:+1:17: +1:23 (_1.0: i32) = const 1_i32; // scope 0 at $DIR/tuple.rs:+1:17: +1:23 (_1.1: i32) = const 2_i32; // scope 0 at $DIR/tuple.rs:+1:17: +1:23 - StorageLive(_2); // scope 1 at $DIR/tuple.rs:+2:9: +2:14 - _2 = &_1; // scope 1 at $DIR/tuple.rs:+2:17: +2:19 - StorageLive(_3); // scope 2 at $DIR/tuple.rs:+3:9: +3:10 - StorageLive(_4); // scope 2 at $DIR/tuple.rs:+3:13: +3:22 - StorageLive(_5); // scope 2 at $DIR/tuple.rs:+3:13: +3:16 -- _5 = (_1.0: i32); // scope 2 at $DIR/tuple.rs:+3:13: +3:16 -+ _5 = const 1_i32; // scope 2 at $DIR/tuple.rs:+3:13: +3:16 - StorageLive(_6); // scope 2 at $DIR/tuple.rs:+3:19: +3:22 -- _6 = ((*_2).1: i32); // scope 2 at $DIR/tuple.rs:+3:19: +3:22 -- _4 = Add(move _5, move _6); // scope 2 at $DIR/tuple.rs:+3:13: +3:22 -+ _6 = const 2_i32; // scope 2 at $DIR/tuple.rs:+3:19: +3:22 -+ _4 = const 3_i32; // scope 2 at $DIR/tuple.rs:+3:13: +3:22 - StorageDead(_6); // scope 2 at $DIR/tuple.rs:+3:21: +3:22 - StorageDead(_5); // scope 2 at $DIR/tuple.rs:+3:21: +3:22 -- _3 = Add(move _4, const 3_i32); // scope 2 at $DIR/tuple.rs:+3:13: +3:26 -+ _3 = const 6_i32; // scope 2 at $DIR/tuple.rs:+3:13: +3:26 - StorageDead(_4); // scope 2 at $DIR/tuple.rs:+3:25: +3:26 - Deinit(_1); // scope 3 at $DIR/tuple.rs:+4:5: +4:15 - (_1.0: i32) = const 2_i32; // scope 3 at $DIR/tuple.rs:+4:5: +4:15 - (_1.1: i32) = const 3_i32; // scope 3 at $DIR/tuple.rs:+4:5: +4:15 - StorageLive(_7); // scope 3 at $DIR/tuple.rs:+5:9: +5:11 - StorageLive(_8); // scope 3 at $DIR/tuple.rs:+5:9: +5:11 - _8 = &_1; // scope 3 at $DIR/tuple.rs:+5:9: +5:11 - _7 = &(*_8); // scope 3 at $DIR/tuple.rs:+5:9: +5:11 - _2 = move _7; // scope 3 at $DIR/tuple.rs:+5:5: +5:11 - StorageDead(_7); // scope 3 at $DIR/tuple.rs:+5:10: +5:11 - StorageDead(_8); // scope 3 at $DIR/tuple.rs:+5:11: +5:12 - StorageLive(_9); // scope 3 at $DIR/tuple.rs:+6:9: +6:10 - StorageLive(_10); // scope 3 at $DIR/tuple.rs:+6:13: +6:22 - StorageLive(_11); // scope 3 at $DIR/tuple.rs:+6:13: +6:16 -- _11 = (_1.0: i32); // scope 3 at $DIR/tuple.rs:+6:13: +6:16 -+ _11 = const 2_i32; // scope 3 at $DIR/tuple.rs:+6:13: +6:16 - StorageLive(_12); // scope 3 at $DIR/tuple.rs:+6:19: +6:22 -- _12 = ((*_2).1: i32); // scope 3 at $DIR/tuple.rs:+6:19: +6:22 -- _10 = Add(move _11, move _12); // scope 3 at $DIR/tuple.rs:+6:13: +6:22 -+ _12 = const 3_i32; // scope 3 at $DIR/tuple.rs:+6:19: +6:22 -+ _10 = const 5_i32; // scope 3 at $DIR/tuple.rs:+6:13: +6:22 - StorageDead(_12); // scope 3 at $DIR/tuple.rs:+6:21: +6:22 - StorageDead(_11); // scope 3 at $DIR/tuple.rs:+6:21: +6:22 -- _9 = Add(move _10, const 4_i32); // scope 3 at $DIR/tuple.rs:+6:13: +6:26 -+ _9 = const 9_i32; // scope 3 at $DIR/tuple.rs:+6:13: +6:26 - StorageDead(_10); // scope 3 at $DIR/tuple.rs:+6:25: +6:26 - _0 = const (); // scope 0 at $DIR/tuple.rs:+0:11: +7:2 - StorageDead(_9); // scope 3 at $DIR/tuple.rs:+7:1: +7:2 - StorageDead(_3); // scope 2 at $DIR/tuple.rs:+7:1: +7:2 - StorageDead(_2); // scope 1 at $DIR/tuple.rs:+7:1: +7:2 - StorageDead(_1); // scope 0 at $DIR/tuple.rs:+7:1: +7:2 - return; // scope 0 at $DIR/tuple.rs:+7:2: +7:2 + StorageLive(_2); // scope 1 at $DIR/tuple.rs:+2:9: +2:10 + StorageLive(_3); // scope 1 at $DIR/tuple.rs:+2:13: +2:22 + StorageLive(_4); // scope 1 at $DIR/tuple.rs:+2:13: +2:16 +- _4 = (_1.0: i32); // scope 1 at $DIR/tuple.rs:+2:13: +2:16 ++ _4 = const 1_i32; // scope 1 at $DIR/tuple.rs:+2:13: +2:16 + StorageLive(_5); // scope 1 at $DIR/tuple.rs:+2:19: +2:22 +- _5 = (_1.1: i32); // scope 1 at $DIR/tuple.rs:+2:19: +2:22 +- _3 = Add(move _4, move _5); // scope 1 at $DIR/tuple.rs:+2:13: +2:22 ++ _5 = const 2_i32; // scope 1 at $DIR/tuple.rs:+2:19: +2:22 ++ _3 = const 3_i32; // scope 1 at $DIR/tuple.rs:+2:13: +2:22 + StorageDead(_5); // scope 1 at $DIR/tuple.rs:+2:21: +2:22 + StorageDead(_4); // scope 1 at $DIR/tuple.rs:+2:21: +2:22 +- _2 = Add(move _3, const 3_i32); // scope 1 at $DIR/tuple.rs:+2:13: +2:26 ++ _2 = const 6_i32; // scope 1 at $DIR/tuple.rs:+2:13: +2:26 + StorageDead(_3); // scope 1 at $DIR/tuple.rs:+2:25: +2:26 + Deinit(_1); // scope 2 at $DIR/tuple.rs:+3:5: +3:15 + (_1.0: i32) = const 2_i32; // scope 2 at $DIR/tuple.rs:+3:5: +3:15 + (_1.1: i32) = const 3_i32; // scope 2 at $DIR/tuple.rs:+3:5: +3:15 + StorageLive(_6); // scope 2 at $DIR/tuple.rs:+4:9: +4:10 + StorageLive(_7); // scope 2 at $DIR/tuple.rs:+4:13: +4:22 + StorageLive(_8); // scope 2 at $DIR/tuple.rs:+4:13: +4:16 +- _8 = (_1.0: i32); // scope 2 at $DIR/tuple.rs:+4:13: +4:16 ++ _8 = const 2_i32; // scope 2 at $DIR/tuple.rs:+4:13: +4:16 + StorageLive(_9); // scope 2 at $DIR/tuple.rs:+4:19: +4:22 +- _9 = (_1.1: i32); // scope 2 at $DIR/tuple.rs:+4:19: +4:22 +- _7 = Add(move _8, move _9); // scope 2 at $DIR/tuple.rs:+4:13: +4:22 ++ _9 = const 3_i32; // scope 2 at $DIR/tuple.rs:+4:19: +4:22 ++ _7 = const 5_i32; // scope 2 at $DIR/tuple.rs:+4:13: +4:22 + StorageDead(_9); // scope 2 at $DIR/tuple.rs:+4:21: +4:22 + StorageDead(_8); // scope 2 at $DIR/tuple.rs:+4:21: +4:22 + StorageLive(_10); // scope 2 at $DIR/tuple.rs:+4:25: +4:26 +- _10 = _2; // scope 2 at $DIR/tuple.rs:+4:25: +4:26 +- _6 = Add(move _7, move _10); // scope 2 at $DIR/tuple.rs:+4:13: +4:26 ++ _10 = const 6_i32; // scope 2 at $DIR/tuple.rs:+4:25: +4:26 ++ _6 = const 11_i32; // scope 2 at $DIR/tuple.rs:+4:13: +4:26 + StorageDead(_10); // scope 2 at $DIR/tuple.rs:+4:25: +4:26 + StorageDead(_7); // scope 2 at $DIR/tuple.rs:+4:25: +4:26 + _0 = const (); // scope 0 at $DIR/tuple.rs:+0:11: +5:2 + StorageDead(_6); // scope 2 at $DIR/tuple.rs:+5:1: +5:2 + StorageDead(_2); // scope 1 at $DIR/tuple.rs:+5:1: +5:2 + StorageDead(_1); // scope 0 at $DIR/tuple.rs:+5:1: +5:2 + return; // scope 0 at $DIR/tuple.rs:+5:2: +5:2 } } diff --git a/src/test/mir-opt/dataflow-const-prop/tuple.rs b/src/test/mir-opt/dataflow-const-prop/tuple.rs index dfc49fe857a..92c70eab0ff 100644 --- a/src/test/mir-opt/dataflow-const-prop/tuple.rs +++ b/src/test/mir-opt/dataflow-const-prop/tuple.rs @@ -1,12 +1,9 @@ // unit-test: DataflowConstProp -// compile-flags: -Zunsound-mir-opts // EMIT_MIR tuple.main.DataflowConstProp.diff fn main() { let mut a = (1, 2); - let mut b = &a; - let c = a.0 + b.1 + 3; + let b = a.0 + a.1 + 3; a = (2, 3); - b = &a; - let d = a.0 + b.1 + 4; + let c = a.0 + a.1 + b; } |
