]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read/rustc.main.ConstProp.diff
Show the values and computation that would overflow a const evaluation or propagation
[rust.git] / src / test / mir-opt / const_prop / mutable_variable_aggregate_partial_read / rustc.main.ConstProp.diff
1 - // MIR for `main` before ConstProp
2 + // MIR for `main` after ConstProp
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:4:11: 4:11
6       let mut _1: (i32, i32);              // in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:5:9: 5:14
7       scope 1 {
8           debug x => _1;                   // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:5:9: 5:14
9           let _2: i32;                     // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:9: 8:10
10           scope 2 {
11               debug y => _2;               // in scope 2 at $DIR/mutable_variable_aggregate_partial_read.rs:8:9: 8:10
12           }
13       }
14   
15       bb0: {
16           StorageLive(_1);                 // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:5:9: 5:14
17           _1 = const foo() -> bb1;         // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:5:29: 5:34
18                                            // ty::Const
19                                            // + ty: fn() -> (i32, i32) {foo}
20                                            // + val: Value(Scalar(<ZST>))
21                                            // mir::Constant
22                                            // + span: $DIR/mutable_variable_aggregate_partial_read.rs:5:29: 5:32
23                                            // + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(Scalar(<ZST>)) }
24       }
25   
26       bb1: {
27           (_1.1: i32) = const 99_i32;      // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:6:5: 6:13
28                                            // ty::Const
29                                            // + ty: i32
30                                            // + val: Value(Scalar(0x00000063))
31                                            // mir::Constant
32                                            // + span: $DIR/mutable_variable_aggregate_partial_read.rs:6:11: 6:13
33                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
34           (_1.0: i32) = const 42_i32;      // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:7:5: 7:13
35                                            // ty::Const
36                                            // + ty: i32
37                                            // + val: Value(Scalar(0x0000002a))
38                                            // mir::Constant
39                                            // + span: $DIR/mutable_variable_aggregate_partial_read.rs:7:11: 7:13
40                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
41           StorageLive(_2);                 // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:9: 8:10
42 -         _2 = (_1.1: i32);                // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:13: 8:16
43 +         _2 = const 99_i32;               // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:13: 8:16
44 +                                          // ty::Const
45 +                                          // + ty: i32
46 +                                          // + val: Value(Scalar(0x00000063))
47 +                                          // mir::Constant
48 +                                          // + span: $DIR/mutable_variable_aggregate_partial_read.rs:8:13: 8:16
49 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
50           _0 = const ();                   // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:4:11: 9:2
51                                            // ty::Const
52                                            // + ty: ()
53                                            // + val: Value(Scalar(<ZST>))
54                                            // mir::Constant
55                                            // + span: $DIR/mutable_variable_aggregate_partial_read.rs:4:11: 9:2
56                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
57           StorageDead(_2);                 // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:9:1: 9:2
58           StorageDead(_1);                 // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:9:1: 9:2
59           return;                          // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:9:2: 9:2
60       }
61   }
62