1 // MIR for `test` before ElaborateDrops
3 fn test() -> Option<Box<u32>> {
4 let mut _0: std::option::Option<std::boxed::Box<u32>>;
5 let mut _1: std::boxed::Box<u32>;
9 let mut _5: std::boxed::Box<u32>;
10 let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>;
11 let mut _7: std::option::Option<u32>;
13 let _9: std::option::Option<std::convert::Infallible>;
15 let mut _11: std::option::Option<std::convert::Infallible>;
34 _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind continue];
39 _5 = ShallowInitBox(move _4, u32);
42 _7 = Option::<u32>::None;
43 _6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12];
48 _8 = discriminant(_6);
49 switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4];
54 _12 = ((_6 as Continue).0: u32);
58 drop(_5) -> [return: bb7, unwind: bb11];
67 _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>);
70 _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12];
76 drop(_5) -> [return: bb9, unwind continue];
81 _0 = Option::<Box<u32>>::Some(move _1);
82 drop(_1) -> [return: bb8, unwind continue];
103 drop(_1) -> [return: bb13, unwind terminate];
107 drop(_5) -> [return: bb13, unwind terminate];