fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
5.0 KiB76 linesraw
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/indirect.rs:4:11: 4:11
6      let _1: u8;                          // in scope 0 at $DIR/indirect.rs:5:9: 5:10
7      let mut _2: u8;                      // in scope 0 at $DIR/indirect.rs:5:13: 5:25
8      let mut _3: (u8, bool);              // in scope 0 at $DIR/indirect.rs:5:13: 5:29
9      scope 1 {
10          debug x => _1;                   // in scope 1 at $DIR/indirect.rs:5:9: 5:10
11      }
12  
13      bb0: {
14          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/indirect.rs:5:9: 5:10
15          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/indirect.rs:5:13: 5:25
16-         _2 = const 2u32 as u8 (Misc);    // bb0[2]: scope 0 at $DIR/indirect.rs:5:13: 5:25
17+         _2 = const 2u8;                  // bb0[2]: scope 0 at $DIR/indirect.rs:5:13: 5:25
18                                           // ty::Const
19-                                          // + ty: u32
20-                                          // + val: Value(Scalar(0x00000002))
21+                                          // + ty: u8
22+                                          // + val: Value(Scalar(0x02))
23                                           // mir::Constant
24-                                          // + span: $DIR/indirect.rs:5:14: 5:18
25-                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
26-         _3 = CheckedAdd(move _2, const 1u8); // bb0[3]: scope 0 at $DIR/indirect.rs:5:13: 5:29
27+                                          // + span: $DIR/indirect.rs:5:13: 5:25
28+                                          // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
29+         _3 = (const 3u8, const false);   // bb0[3]: scope 0 at $DIR/indirect.rs:5:13: 5:29
30                                           // ty::Const
31                                           // + ty: u8
32-                                          // + val: Value(Scalar(0x01))
33+                                          // + val: Value(Scalar(0x03))
34                                           // mir::Constant
35-                                          // + span: $DIR/indirect.rs:5:28: 5:29
36-                                          // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
37-         assert(!move (_3.1: bool), "attempt to add with overflow") -> bb1; // bb0[4]: scope 0 at $DIR/indirect.rs:5:13: 5:29
38+                                          // + span: $DIR/indirect.rs:5:13: 5:29
39+                                          // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
40+                                          // ty::Const
41+                                          // + ty: bool
42+                                          // + val: Value(Scalar(0x00))
43+                                          // mir::Constant
44+                                          // + span: $DIR/indirect.rs:5:13: 5:29
45+                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
46+         assert(!const false, "attempt to add with overflow") -> bb1; // bb0[4]: scope 0 at $DIR/indirect.rs:5:13: 5:29
47+                                          // ty::Const
48+                                          // + ty: bool
49+                                          // + val: Value(Scalar(0x00))
50+                                          // mir::Constant
51+                                          // + span: $DIR/indirect.rs:5:13: 5:29
52+                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
53      }
54  
55      bb1: {
56-         _1 = move (_3.0: u8);            // bb1[0]: scope 0 at $DIR/indirect.rs:5:13: 5:29
57+         _1 = const 3u8;                  // bb1[0]: scope 0 at $DIR/indirect.rs:5:13: 5:29
58+                                          // ty::Const
59+                                          // + ty: u8
60+                                          // + val: Value(Scalar(0x03))
61+                                          // mir::Constant
62+                                          // + span: $DIR/indirect.rs:5:13: 5:29
63+                                          // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
64          StorageDead(_2);                 // bb1[1]: scope 0 at $DIR/indirect.rs:5:28: 5:29
65          _0 = const ();                   // bb1[2]: scope 0 at $DIR/indirect.rs:4:11: 6:2
66                                           // ty::Const
67                                           // + ty: ()
68                                           // + val: Value(Scalar(<ZST>))
69                                           // mir::Constant
70                                           // + span: $DIR/indirect.rs:4:11: 6:2
71                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
72          StorageDead(_1);                 // bb1[3]: scope 0 at $DIR/indirect.rs:6:1: 6:2
73          return;                          // bb1[4]: scope 0 at $DIR/indirect.rs:6:2: 6:2
74      }
75  }
76