]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_prop/aggregate.main.ConstProp.diff
Auto merge of #107267 - cjgillot:keep-aggregate, r=oli-obk
[rust.git] / tests / mir-opt / const_prop / aggregate.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/aggregate.rs:+0:11: +0:11
6       let _1: u8;                          // in scope 0 at $DIR/aggregate.rs:+1:9: +1:10
7       let mut _2: u8;                      // in scope 0 at $DIR/aggregate.rs:+1:13: +1:24
8       let mut _3: (i32, u8, i32);          // in scope 0 at $DIR/aggregate.rs:+1:13: +1:22
9       let _4: ();                          // in scope 0 at $DIR/aggregate.rs:+2:5: +2:11
10       let mut _5: u8;                      // in scope 0 at $DIR/aggregate.rs:+2:9: +2:10
11       scope 1 {
12           debug x => _1;                   // in scope 1 at $DIR/aggregate.rs:+1:9: +1:10
13       }
14   
15       bb0: {
16           StorageLive(_1);                 // scope 0 at $DIR/aggregate.rs:+1:9: +1:10
17           StorageLive(_2);                 // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
18           StorageLive(_3);                 // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
19           _3 = (const 0_i32, const 1_u8, const 2_i32); // scope 0 at $DIR/aggregate.rs:+1:13: +1:22
20 -         _2 = (_3.1: u8);                 // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
21 -         _1 = Add(move _2, const 0_u8);   // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
22 +         _2 = const 1_u8;                 // scope 0 at $DIR/aggregate.rs:+1:13: +1:24
23 +         _1 = const 1_u8;                 // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
24           StorageDead(_2);                 // scope 0 at $DIR/aggregate.rs:+1:27: +1:28
25           StorageDead(_3);                 // scope 0 at $DIR/aggregate.rs:+1:28: +1:29
26           StorageLive(_4);                 // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
27           StorageLive(_5);                 // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
28 -         _5 = _1;                         // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
29 +         _5 = const 1_u8;                 // scope 1 at $DIR/aggregate.rs:+2:9: +2:10
30           _4 = foo(move _5) -> bb1;        // scope 1 at $DIR/aggregate.rs:+2:5: +2:11
31                                            // mir::Constant
32                                            // + span: $DIR/aggregate.rs:8:5: 8:8
33                                            // + literal: Const { ty: fn(u8) {foo}, val: Value(<ZST>) }
34       }
35   
36       bb1: {
37           StorageDead(_5);                 // scope 1 at $DIR/aggregate.rs:+2:10: +2:11
38           StorageDead(_4);                 // scope 1 at $DIR/aggregate.rs:+2:11: +2:12
39           _0 = const ();                   // scope 0 at $DIR/aggregate.rs:+0:11: +3:2
40           StorageDead(_1);                 // scope 0 at $DIR/aggregate.rs:+3:1: +3:2
41           return;                          // scope 0 at $DIR/aggregate.rs:+3:2: +3:2
42       }
43   }
44