fork/rust

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

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

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