fork/rust

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

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

1.44.0
6.7 KiB101 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/discriminant.rs:5:11: 5:11
6      let _1: i32;                         // in scope 0 at $DIR/discriminant.rs:6:9: 6:10
7      let mut _2: i32;                     // in scope 0 at $DIR/discriminant.rs:6:13: 6:64
8      let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:6:34: 6:44
9      let mut _4: isize;                   // in scope 0 at $DIR/discriminant.rs:6:21: 6:31
10      scope 1 {
11          debug x => _1;                   // in scope 1 at $DIR/discriminant.rs:6:9: 6:10
12      }
13  
14      bb0: {
15          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/discriminant.rs:6:9: 6:10
16          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
17          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
18-         _3 = std::option::Option::<bool>::Some(const true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
19+         _3 = const std::option::Option::<bool>::Some(true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
20                                           // ty::Const
21-                                          // + ty: bool
22+                                          // + ty: std::option::Option<bool>
23                                           // + val: Value(Scalar(0x01))
24                                           // mir::Constant
25-                                          // + span: $DIR/discriminant.rs:6:39: 6:43
26-                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
27-         _4 = discriminant(_3);           // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
28-         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
29+                                          // + span: $DIR/discriminant.rs:6:34: 6:44
30+                                          // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
31+         _4 = const 1isize;               // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
32+                                          // ty::Const
33+                                          // + ty: isize
34+                                          // + val: Value(Scalar(0x0000000000000001))
35+                                          // mir::Constant
36+                                          // + span: $DIR/discriminant.rs:6:21: 6:31
37+                                          // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
38+         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
39+                                          // ty::Const
40+                                          // + ty: isize
41+                                          // + val: Value(Scalar(0x0000000000000001))
42+                                          // mir::Constant
43+                                          // + span: $DIR/discriminant.rs:6:21: 6:31
44+                                          // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
45      }
46  
47      bb1: {
48          _2 = const 10i32;                // bb1[0]: scope 0 at $DIR/discriminant.rs:6:59: 6:61
49                                           // ty::Const
50                                           // + ty: i32
51                                           // + val: Value(Scalar(0x0000000a))
52                                           // mir::Constant
53                                           // + span: $DIR/discriminant.rs:6:59: 6:61
54                                           // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
55          goto -> bb4;                     // bb1[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
56      }
57  
58      bb2: {
59-         switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
60+         switchInt(const true) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
61+                                          // ty::Const
62+                                          // + ty: bool
63+                                          // + val: Value(Scalar(0x01))
64+                                          // mir::Constant
65+                                          // + span: $DIR/discriminant.rs:6:26: 6:30
66+                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
67      }
68  
69      bb3: {
70          _2 = const 42i32;                // bb3[0]: scope 0 at $DIR/discriminant.rs:6:47: 6:49
71                                           // ty::Const
72                                           // + ty: i32
73                                           // + val: Value(Scalar(0x0000002a))
74                                           // mir::Constant
75                                           // + span: $DIR/discriminant.rs:6:47: 6:49
76                                           // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
77          goto -> bb4;                     // bb3[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
78      }
79  
80      bb4: {
81          _1 = Add(move _2, const 0i32);   // bb4[0]: scope 0 at $DIR/discriminant.rs:6:13: 6:68
82                                           // ty::Const
83                                           // + ty: i32
84                                           // + val: Value(Scalar(0x00000000))
85                                           // mir::Constant
86                                           // + span: $DIR/discriminant.rs:6:67: 6:68
87                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
88          StorageDead(_2);                 // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68
89          StorageDead(_3);                 // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69
90          _0 = const ();                   // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2
91                                           // ty::Const
92                                           // + ty: ()
93                                           // + val: Value(Scalar(<ZST>))
94                                           // mir::Constant
95                                           // + span: $DIR/discriminant.rs:5:11: 7:2
96                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
97          StorageDead(_1);                 // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2
98          return;                          // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2
99      }
100  }
101