fork/rust

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

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

master
1.3 KiB50 linesraw
1- // MIR for `unwrap_unchecked` before Inline
2+ // MIR for `unwrap_unchecked` after Inline
3  
4  fn unwrap_unchecked(_1: Option<T>) -> T {
5      debug slf => _1;
6      let mut _0: T;
7      let mut _2: std::option::Option<T>;
8+     scope 1 (inlined #[track_caller] Option::<T>::unwrap_unchecked) {
9+         debug self => _2;
10+         let mut _3: &std::option::Option<T>;
11+         let mut _4: isize;
12+         scope 2 {
13+             debug val => _0;
14+         }
15+         scope 3 {
16+             scope 5 (inlined unreachable_unchecked) {
17+                 scope 6 {
18+                     scope 7 (inlined unreachable_unchecked::runtime) {
19+                     }
20+                 }
21+             }
22+         }
23+         scope 4 (inlined Option::<T>::is_some) {
24+             debug self => _3;
25+         }
26+     }
27  
28      bb0: {
29          StorageLive(_2);
30          _2 = move _1;
31-         _0 = Option::<T>::unwrap_unchecked(move _2) -> [return: bb1, unwind unreachable];
32+         StorageLive(_3);
33+         StorageLive(_4);
34+         _4 = discriminant(_2);
35+         switchInt(move _4) -> [1: bb2, otherwise: bb1];
36      }
37  
38      bb1: {
39+         unreachable;
40+     }
41+ 
42+     bb2: {
43+         _0 = move ((_2 as Some).0: T);
44+         StorageDead(_4);
45+         StorageDead(_3);
46          StorageDead(_2);
47          return;
48      }
49  }
50