]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/cast/rustc.main.ConstProp.diff
Fix wrong argument in autoderef process
[rust.git] / src / test / mir-opt / const_prop / cast / 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/cast.rs:3:11: 3:11
6       let _1: u32;                         // in scope 0 at $DIR/cast.rs:4:9: 4:10
7       scope 1 {
8           debug x => _1;                   // in scope 1 at $DIR/cast.rs:4:9: 4:10
9           let _2: u8;                      // in scope 1 at $DIR/cast.rs:6:9: 6:10
10           scope 2 {
11               debug y => _2;               // in scope 2 at $DIR/cast.rs:6:9: 6:10
12           }
13       }
14   
15       bb0: {
16           StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/cast.rs:4:9: 4:10
17 -         _1 = const 42u8 as u32 (Misc);   // bb0[1]: scope 0 at $DIR/cast.rs:4:13: 4:24
18 +         _1 = const 42u32;                // bb0[1]: scope 0 at $DIR/cast.rs:4:13: 4:24
19                                            // ty::Const
20 -                                          // + ty: u8
21 -                                          // + val: Value(Scalar(0x2a))
22 -                                          // mir::Constant
23 -                                          // + span: $DIR/cast.rs:4:13: 4:17
24 -                                          // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
25 -         StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/cast.rs:6:9: 6:10
26 -         _2 = const 42u32 as u8 (Misc);   // bb0[3]: scope 1 at $DIR/cast.rs:6:13: 6:24
27 -                                          // ty::Const
28                                            // + ty: u32
29                                            // + val: Value(Scalar(0x0000002a))
30                                            // mir::Constant
31 -                                          // + span: $DIR/cast.rs:6:13: 6:18
32 +                                          // + span: $DIR/cast.rs:4:13: 4:24
33                                            // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
34 +         StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/cast.rs:6:9: 6:10
35 +         _2 = const 42u8;                 // bb0[3]: scope 1 at $DIR/cast.rs:6:13: 6:24
36 +                                          // ty::Const
37 +                                          // + ty: u8
38 +                                          // + val: Value(Scalar(0x2a))
39 +                                          // mir::Constant
40 +                                          // + span: $DIR/cast.rs:6:13: 6:24
41 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
42           _0 = const ();                   // bb0[4]: scope 0 at $DIR/cast.rs:3:11: 7:2
43                                            // ty::Const
44                                            // + ty: ()
45                                            // + val: Value(Scalar(<ZST>))
46                                            // mir::Constant
47                                            // + span: $DIR/cast.rs:3:11: 7:2
48                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
49           StorageDead(_2);                 // bb0[5]: scope 1 at $DIR/cast.rs:7:1: 7:2
50           StorageDead(_1);                 // bb0[6]: scope 0 at $DIR/cast.rs:7:1: 7:2
51           return;                          // bb0[7]: scope 0 at $DIR/cast.rs:7:2: 7:2
52       }
53   }
54