fork/rust

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

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

master
1.2 KiB50 linesraw
1- // MIR for `foo` before SimplifyLocals-final
2+ // MIR for `foo` after SimplifyLocals-final
3  
4  fn foo() -> () {
5      let mut _0: ();
6      let mut _1: (std::option::Option<u8>, std::option::Option<T>);
7      let mut _2: std::option::Option<u8>;
8      let mut _3: std::option::Option<T>;
9      let mut _4: isize;
10      let mut _5: isize;
11      scope 1 {
12          debug a => _6;
13          let _6: u8;
14      }
15  
16      bb0: {
17          StorageLive(_1);
18          StorageLive(_2);
19          _2 = Option::<u8>::None;
20          StorageLive(_3);
21          _3 = Option::<T>::None;
22          _1 = (move _2, move _3);
23          StorageDead(_3);
24          StorageDead(_2);
25          _5 = discriminant((_1.0: std::option::Option<u8>));
26          switchInt(move _5) -> [1: bb1, otherwise: bb3];
27      }
28  
29      bb1: {
30          _4 = discriminant((_1.1: std::option::Option<T>));
31          switchInt(move _4) -> [0: bb2, otherwise: bb3];
32      }
33  
34      bb2: {
35          StorageLive(_6);
36          _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8);
37          StorageDead(_6);
38          goto -> bb3;
39      }
40  
41      bb3: {
42          drop(_1) -> [return: bb4, unwind continue];
43      }
44  
45      bb4: {
46          StorageDead(_1);
47          return;
48      }
49  }
50