- // MIR for `chained_conditions` before JumpThreading + // MIR for `chained_conditions` after JumpThreading fn chained_conditions() -> u8 { let mut _0: u8; let _1: chained_conditions::BacktraceStyle; let mut _2: std::option::Option; let mut _3: &std::option::Option; let mut _4: isize; let _5: std::string::String; let _6: &std::string::String; let mut _7: bool; let mut _8: &&std::string::String; let _9: &std::string::String; let mut _10: &&str; let _11: &str; let _12: std::string::String; let _13: &std::string::String; let mut _14: bool; let mut _15: &&std::string::String; let _16: &std::string::String; let mut _17: &&str; let _18: &str; let mut _19: isize; let mut _20: &&str; let mut _21: &&str; let mut _22: bool; let mut _23: bool; let mut _24: isize; let mut _25: isize; let mut _26: isize; scope 1 { debug format => _1; } scope 2 { debug x => _5; debug x => _6; } scope 3 { debug x => _12; debug x => _13; } scope 4 (inlined std::cmp::impls:: for &String>::eq) { let mut _27: &std::string::String; let mut _28: &str; scope 5 (inlined >::eq) { scope 6 (inlined #[track_caller] >::index) { let _29: &str; scope 7 (inlined String::as_str) { let _30: &[u8]; scope 8 (inlined Vec::::as_slice) { let _31: *const [u8]; let mut _32: *const u8; let mut _33: usize; scope 9 (inlined Vec::::as_ptr) { scope 10 (inlined alloc::raw_vec::RawVec::::ptr) { scope 11 (inlined alloc::raw_vec::RawVecInner::ptr::) { scope 12 (inlined alloc::raw_vec::RawVecInner::non_null::) { let mut _34: std::ptr::NonNull; scope 13 (inlined std::ptr::Unique::::cast::) { scope 14 (inlined NonNull::::cast::) { scope 15 (inlined NonNull::::as_ptr) { } } } scope 16 (inlined std::ptr::Unique::::as_non_null_ptr) { } } scope 17 (inlined NonNull::::as_ptr) { } } } } } scope 18 (inlined from_utf8_unchecked) { } } scope 19 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { } } scope 20 (inlined #[track_caller] core::str::traits:: for str>::index) { scope 21 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { } } scope 22 (inlined core::str::traits::::eq) { let mut _35: &&[u8]; let _36: &[u8]; let mut _37: &&[u8]; let _38: &[u8]; scope 23 (inlined core::str::::as_bytes) { } scope 24 (inlined core::str::::as_bytes) { } scope 25 (inlined std::cmp::impls::::eq) { scope 26 (inlined core::slice::cmp::::eq) { let _39: usize; let mut _40: bool; let mut _41: usize; let mut _42: *const u8; let mut _43: *const u8; scope 27 { scope 28 (inlined core::slice::::as_ptr) { let mut _44: *const [u8]; } scope 29 (inlined core::slice::::as_ptr) { let mut _45: *const [u8]; } scope 30 (inlined >::equal_same_length) { let mut _46: i32; scope 31 { } } } } } } } } scope 32 (inlined std::cmp::impls:: for &String>::eq) { let mut _47: &std::string::String; let mut _48: &str; scope 33 (inlined >::eq) { scope 34 (inlined #[track_caller] >::index) { let _49: &str; scope 35 (inlined String::as_str) { let _50: &[u8]; scope 36 (inlined Vec::::as_slice) { let _51: *const [u8]; let mut _52: *const u8; let mut _53: usize; scope 37 (inlined Vec::::as_ptr) { scope 38 (inlined alloc::raw_vec::RawVec::::ptr) { scope 39 (inlined alloc::raw_vec::RawVecInner::ptr::) { scope 40 (inlined alloc::raw_vec::RawVecInner::non_null::) { let mut _54: std::ptr::NonNull; scope 41 (inlined std::ptr::Unique::::cast::) { scope 42 (inlined NonNull::::cast::) { scope 43 (inlined NonNull::::as_ptr) { } } } scope 44 (inlined std::ptr::Unique::::as_non_null_ptr) { } } scope 45 (inlined NonNull::::as_ptr) { } } } } } scope 46 (inlined from_utf8_unchecked) { } } scope 47 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { } } scope 48 (inlined #[track_caller] core::str::traits:: for str>::index) { scope 49 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { } } scope 50 (inlined core::str::traits::::eq) { let mut _55: &&[u8]; let _56: &[u8]; let mut _57: &&[u8]; let _58: &[u8]; scope 51 (inlined core::str::::as_bytes) { } scope 52 (inlined core::str::::as_bytes) { } scope 53 (inlined std::cmp::impls::::eq) { scope 54 (inlined core::slice::cmp::::eq) { let _59: usize; let mut _60: bool; let mut _61: usize; let mut _62: *const u8; let mut _63: *const u8; scope 55 { scope 56 (inlined core::slice::::as_ptr) { let mut _64: *const [u8]; } scope 57 (inlined core::slice::::as_ptr) { let mut _65: *const [u8]; } scope 58 (inlined >::equal_same_length) { let mut _66: i32; scope 59 { } } } } } } } } bb0: { _22 = const false; _23 = const false; StorageLive(_1); StorageLive(_2); _22 = const true; _23 = const true; _2 = env_var() -> [return: bb1, unwind continue]; } bb1: { _4 = discriminant(_2); switchInt(move _4) -> [0: bb3, 1: bb4, otherwise: bb2]; } bb2: { unreachable; } bb3: { _1 = chained_conditions::BacktraceStyle::Off; - goto -> bb19; + goto -> bb33; } bb4: { StorageLive(_6); _6 = &((_2 as Some).0: std::string::String); StorageLive(_7); StorageLive(_8); StorageLive(_9); _9 = &(*_6); _8 = &_9; StorageLive(_10); _21 = const chained_conditions::promoted[1]; _10 = &(*_21); StorageLive(_27); StorageLive(_28); _27 = copy (*_8); _28 = copy (*_10); StorageLive(_29); StorageLive(_30); StorageLive(_31); StorageLive(_32); StorageLive(_34); _34 = copy ((((((*_27).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); _32 = copy _34 as *const u8 (Transmute); StorageDead(_34); StorageLive(_33); _33 = copy (((*_27).0: std::vec::Vec).1: usize); _31 = *const [u8] from (copy _32, move _33); StorageDead(_33); StorageDead(_32); _30 = &(*_31); StorageDead(_31); _29 = copy _30 as &str (Transmute); StorageDead(_30); StorageLive(_36); StorageLive(_38); StorageLive(_39); StorageLive(_42); StorageLive(_43); _36 = copy _29 as &[u8] (Transmute); _38 = copy _28 as &[u8] (Transmute); _39 = PtrMetadata(copy _36); StorageLive(_40); StorageLive(_41); _41 = PtrMetadata(copy _38); _40 = Eq(copy _39, move _41); switchInt(move _40) -> [0: bb24, otherwise: bb23]; } bb5: { StorageDead(_10); StorageDead(_9); StorageDead(_8); StorageDead(_7); StorageLive(_5); _23 = const false; _5 = move ((_2 as Some).0: std::string::String); _1 = chained_conditions::BacktraceStyle::Full; drop(_5) -> [return: bb7, unwind: bb22]; } bb6: { StorageDead(_10); StorageDead(_9); StorageDead(_8); StorageDead(_7); StorageDead(_6); StorageLive(_13); _13 = &((_2 as Some).0: std::string::String); StorageLive(_14); StorageLive(_15); StorageLive(_16); _16 = &(*_13); _15 = &_16; StorageLive(_17); _20 = const chained_conditions::promoted[0]; _17 = &(*_20); StorageLive(_47); StorageLive(_48); _47 = copy (*_15); _48 = copy (*_17); StorageLive(_49); StorageLive(_50); StorageLive(_51); StorageLive(_52); StorageLive(_54); _54 = copy ((((((*_47).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); _52 = copy _54 as *const u8 (Transmute); StorageDead(_54); StorageLive(_53); _53 = copy (((*_47).0: std::vec::Vec).1: usize); _51 = *const [u8] from (copy _52, move _53); StorageDead(_53); StorageDead(_52); _50 = &(*_51); StorageDead(_51); _49 = copy _50 as &str (Transmute); StorageDead(_50); StorageLive(_56); StorageLive(_58); StorageLive(_59); StorageLive(_62); StorageLive(_63); _56 = copy _49 as &[u8] (Transmute); _58 = copy _48 as &[u8] (Transmute); _59 = PtrMetadata(copy _56); StorageLive(_60); StorageLive(_61); _61 = PtrMetadata(copy _58); _60 = Eq(copy _59, move _61); switchInt(move _60) -> [0: bb28, otherwise: bb27]; } bb7: { StorageDead(_5); StorageDead(_6); - goto -> bb19; + goto -> bb31; } bb8: { StorageDead(_17); StorageDead(_16); StorageDead(_15); StorageDead(_14); StorageLive(_12); _23 = const false; _12 = move ((_2 as Some).0: std::string::String); _1 = chained_conditions::BacktraceStyle::Off; drop(_12) -> [return: bb10, unwind: bb22]; } bb9: { StorageDead(_17); StorageDead(_16); StorageDead(_15); StorageDead(_14); StorageDead(_13); _1 = chained_conditions::BacktraceStyle::Short; - goto -> bb19; + goto -> bb33; } bb10: { StorageDead(_12); StorageDead(_13); - goto -> bb19; + goto -> bb31; } bb11: { _0 = const 3_u8; goto -> bb14; } bb12: { _0 = const 2_u8; goto -> bb14; } bb13: { _0 = const 1_u8; goto -> bb14; } bb14: { StorageDead(_1); return; } bb15 (cleanup): { resume; } bb16: { _22 = const false; _23 = const false; StorageDead(_2); _19 = discriminant(_1); switchInt(move _19) -> [0: bb13, 1: bb12, 2: bb11, otherwise: bb2]; } bb17: { switchInt(copy _23) -> [0: bb16, otherwise: bb18]; } bb18: { drop(((_2 as Some).0: std::string::String)) -> [return: bb16, unwind: bb15]; } bb19: { _24 = discriminant(_2); switchInt(move _24) -> [1: bb17, otherwise: bb16]; } bb20 (cleanup): { switchInt(copy _23) -> [0: bb15, otherwise: bb21]; } bb21 (cleanup): { drop(((_2 as Some).0: std::string::String)) -> [return: bb15, unwind terminate(cleanup)]; } bb22 (cleanup): { _26 = discriminant(_2); switchInt(move _26) -> [1: bb20, otherwise: bb15]; } bb23: { StorageDead(_41); StorageLive(_44); _44 = &raw const (*_36); _42 = copy _44 as *const u8 (PtrToPtr); StorageDead(_44); StorageLive(_45); _45 = &raw const (*_38); _43 = copy _45 as *const u8 (PtrToPtr); StorageDead(_45); StorageLive(_46); _46 = compare_bytes(move _42, move _43, move _39) -> [return: bb26, unwind unreachable]; } bb24: { StorageDead(_41); _7 = const false; - goto -> bb25; + goto -> bb36; } bb25: { StorageDead(_40); StorageDead(_43); StorageDead(_42); StorageDead(_39); StorageDead(_38); StorageDead(_36); StorageDead(_29); StorageDead(_28); StorageDead(_27); switchInt(move _7) -> [0: bb6, otherwise: bb5]; } bb26: { _7 = Eq(move _46, const 0_i32); StorageDead(_46); goto -> bb25; } bb27: { StorageDead(_61); StorageLive(_64); _64 = &raw const (*_56); _62 = copy _64 as *const u8 (PtrToPtr); StorageDead(_64); StorageLive(_65); _65 = &raw const (*_58); _63 = copy _65 as *const u8 (PtrToPtr); StorageDead(_65); StorageLive(_66); _66 = compare_bytes(move _62, move _63, move _59) -> [return: bb30, unwind unreachable]; } bb28: { StorageDead(_61); _14 = const false; - goto -> bb29; + goto -> bb35; } bb29: { StorageDead(_60); StorageDead(_63); StorageDead(_62); StorageDead(_59); StorageDead(_58); StorageDead(_56); StorageDead(_49); StorageDead(_48); StorageDead(_47); switchInt(move _14) -> [0: bb9, otherwise: bb8]; } bb30: { _14 = Eq(move _66, const 0_i32); StorageDead(_66); goto -> bb29; + } + + bb31: { + _24 = discriminant(_2); + switchInt(move _24) -> [1: bb32, otherwise: bb16]; + } + + bb32: { + goto -> bb16; + } + + bb33: { + _24 = discriminant(_2); + switchInt(move _24) -> [1: bb34, otherwise: bb16]; + } + + bb34: { + goto -> bb18; + } + + bb35: { + StorageDead(_60); + StorageDead(_63); + StorageDead(_62); + StorageDead(_59); + StorageDead(_58); + StorageDead(_56); + StorageDead(_49); + StorageDead(_48); + StorageDead(_47); + goto -> bb9; + } + + bb36: { + StorageDead(_40); + StorageDead(_43); + StorageDead(_42); + StorageDead(_39); + StorageDead(_38); + StorageDead(_36); + StorageDead(_29); + StorageDead(_28); + StorageDead(_27); + goto -> bb6; } }