fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.0 KiB87 linesraw
1- // MIR for `main` before ElaborateDrops
2+ // MIR for `main` after ElaborateDrops
3  
4  fn main() -> () {
5      let mut _0: ();
6      let _1: bool;
7      let mut _3: bool;
8      let mut _6: std::option::Option<std::boxed::Box<u32>>;
9      scope 1 {
10          debug nodrop_x => _1;
11          let _2: bool;
12          scope 2 {
13              debug nodrop_y => _2;
14              let _4: std::option::Option<std::boxed::Box<u32>>;
15              scope 3 {
16                  debug drop_x => _4;
17                  let _5: std::option::Option<std::boxed::Box<u32>>;
18                  scope 4 {
19                      debug drop_y => _5;
20                  }
21              }
22          }
23      }
24  
25      bb0: {
26          StorageLive(_1);
27          _1 = const false;
28          StorageLive(_2);
29          StorageLive(_3);
30          _3 = _1;
31          _2 = move _3;
32          StorageDead(_3);
33          StorageLive(_4);
34          _4 = Option::<Box<u32>>::None;
35          StorageLive(_5);
36          StorageLive(_6);
37          _6 = move _4;
38-         drop(_5) -> [return: bb1, unwind: bb2];
39+         goto -> bb1;
40      }
41  
42      bb1: {
43          _5 = move _6;
44-         drop(_6) -> [return: bb3, unwind: bb6];
45+         goto -> bb3;
46      }
47  
48      bb2 (cleanup): {
49          _5 = move _6;
50-         drop(_6) -> [return: bb6, unwind terminate(cleanup)];
51+         goto -> bb6;
52      }
53  
54      bb3: {
55          StorageDead(_6);
56          _0 = const ();
57          drop(_5) -> [return: bb4, unwind: bb7];
58      }
59  
60      bb4: {
61          StorageDead(_5);
62-         drop(_4) -> [return: bb5, unwind continue];
63+         goto -> bb5;
64      }
65  
66      bb5: {
67          StorageDead(_4);
68          StorageDead(_2);
69          StorageDead(_1);
70          return;
71      }
72  
73      bb6 (cleanup): {
74-         drop(_5) -> [return: bb7, unwind terminate(cleanup)];
75+         goto -> bb7;
76      }
77  
78      bb7 (cleanup): {
79-         drop(_4) -> [return: bb8, unwind terminate(cleanup)];
80+         goto -> bb8;
81      }
82  
83      bb8 (cleanup): {
84          resume;
85      }
86  }
87