2023-09-23 07:56:59 +00:00
|
|
|
- // MIR for `slices` before GVN
|
|
|
|
+ // MIR for `slices` after GVN
|
|
|
|
|
|
|
|
fn slices() -> () {
|
|
|
|
let mut _0: ();
|
|
|
|
let _1: &str;
|
|
|
|
let _2: ();
|
|
|
|
let mut _3: &str;
|
|
|
|
let _5: ();
|
|
|
|
let mut _6: &str;
|
|
|
|
let _7: ();
|
|
|
|
let mut _8: (&*const u8, &*const u8);
|
|
|
|
let mut _9: &*const u8;
|
|
|
|
let _10: *const u8;
|
|
|
|
let mut _11: &str;
|
|
|
|
let mut _12: &*const u8;
|
|
|
|
let _13: *const u8;
|
|
|
|
let mut _14: &str;
|
|
|
|
let mut _17: bool;
|
|
|
|
let mut _18: *const u8;
|
|
|
|
let mut _19: *const u8;
|
|
|
|
let mut _20: !;
|
|
|
|
let _22: !;
|
|
|
|
let mut _23: core::panicking::AssertKind;
|
|
|
|
let mut _24: &*const u8;
|
|
|
|
let _25: &*const u8;
|
|
|
|
let mut _26: &*const u8;
|
|
|
|
let _27: &*const u8;
|
|
|
|
let mut _28: std::option::Option<std::fmt::Arguments<'_>>;
|
|
|
|
let mut _30: &str;
|
|
|
|
let _31: ();
|
|
|
|
let mut _32: &[u8];
|
|
|
|
let _33: ();
|
|
|
|
let mut _34: (&*const u8, &*const u8);
|
|
|
|
let mut _35: &*const u8;
|
|
|
|
let _36: *const u8;
|
|
|
|
let mut _37: &str;
|
|
|
|
let mut _38: &*const u8;
|
|
|
|
let _39: *const u8;
|
|
|
|
let mut _40: &[u8];
|
|
|
|
let mut _43: bool;
|
|
|
|
let mut _44: *const u8;
|
|
|
|
let mut _45: *const u8;
|
|
|
|
let mut _46: !;
|
|
|
|
let _48: !;
|
|
|
|
let mut _49: core::panicking::AssertKind;
|
|
|
|
let mut _50: &*const u8;
|
|
|
|
let _51: &*const u8;
|
|
|
|
let mut _52: &*const u8;
|
|
|
|
let _53: &*const u8;
|
|
|
|
let mut _54: std::option::Option<std::fmt::Arguments<'_>>;
|
|
|
|
scope 1 {
|
|
|
|
debug s => _1;
|
|
|
|
let _4: &str;
|
|
|
|
scope 2 {
|
|
|
|
debug t => _4;
|
|
|
|
let _15: &*const u8;
|
|
|
|
let _16: &*const u8;
|
|
|
|
let _29: &[u8];
|
|
|
|
scope 3 {
|
|
|
|
debug left_val => _15;
|
|
|
|
debug right_val => _16;
|
|
|
|
let _21: core::panicking::AssertKind;
|
|
|
|
scope 4 {
|
|
|
|
debug kind => _21;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scope 5 {
|
|
|
|
debug u => _29;
|
|
|
|
let _41: &*const u8;
|
|
|
|
let _42: &*const u8;
|
|
|
|
scope 7 {
|
|
|
|
debug left_val => _41;
|
|
|
|
debug right_val => _42;
|
|
|
|
let _47: core::panicking::AssertKind;
|
|
|
|
scope 8 {
|
|
|
|
debug kind => _47;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scope 6 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
|
|
|
- StorageLive(_1);
|
2023-09-16 17:13:30 +00:00
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
_1 = const "my favourite slice";
|
|
|
|
StorageLive(_2);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageLive(_3);
|
|
|
|
_3 = _1;
|
2023-09-23 07:56:59 +00:00
|
|
|
- _2 = opaque::<&str>(move _3) -> [return: bb1, unwind unreachable];
|
|
|
|
+ _2 = opaque::<&str>(_1) -> [return: bb1, unwind unreachable];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageDead(_3);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_2);
|
|
|
|
StorageLive(_4);
|
|
|
|
_4 = _1;
|
|
|
|
StorageLive(_5);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageLive(_6);
|
2023-09-23 07:56:59 +00:00
|
|
|
- _6 = _4;
|
|
|
|
- _5 = opaque::<&str>(move _6) -> [return: bb2, unwind unreachable];
|
2023-09-16 17:13:30 +00:00
|
|
|
+ _6 = _1;
|
2023-09-23 07:56:59 +00:00
|
|
|
+ _5 = opaque::<&str>(_1) -> [return: bb2, unwind unreachable];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageDead(_6);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_5);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageLive(_7);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_8);
|
2023-09-16 09:35:46 +00:00
|
|
|
- StorageLive(_9);
|
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_10);
|
|
|
|
StorageLive(_11);
|
|
|
|
_11 = &(*_1);
|
|
|
|
_10 = core::str::<impl str>::as_ptr(move _11) -> [return: bb3, unwind unreachable];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
|
|
|
StorageDead(_11);
|
|
|
|
_9 = &_10;
|
2023-09-16 09:35:46 +00:00
|
|
|
- StorageLive(_12);
|
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_13);
|
|
|
|
StorageLive(_14);
|
2023-09-16 09:16:04 +00:00
|
|
|
- _14 = &(*_4);
|
|
|
|
+ _14 = &(*_1);
|
2023-09-23 07:56:59 +00:00
|
|
|
_13 = core::str::<impl str>::as_ptr(move _14) -> [return: bb4, unwind unreachable];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
|
|
|
StorageDead(_14);
|
|
|
|
_12 = &_13;
|
2023-09-16 09:35:46 +00:00
|
|
|
- _8 = (move _9, move _12);
|
|
|
|
- StorageDead(_12);
|
|
|
|
- StorageDead(_9);
|
|
|
|
+ _8 = (_9, _12);
|
2023-09-16 09:16:04 +00:00
|
|
|
+ nop;
|
|
|
|
+ nop;
|
2023-09-16 09:35:46 +00:00
|
|
|
StorageLive(_15);
|
|
|
|
- _15 = (_8.0: &*const u8);
|
|
|
|
+ _15 = _9;
|
|
|
|
StorageLive(_16);
|
|
|
|
- _16 = (_8.1: &*const u8);
|
|
|
|
+ _16 = _12;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_17);
|
|
|
|
StorageLive(_18);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _18 = (*_15);
|
|
|
|
+ _18 = (*_9);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_19);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _19 = (*_16);
|
|
|
|
+ _19 = (*_12);
|
2023-09-23 07:56:59 +00:00
|
|
|
_17 = Eq(move _18, move _19);
|
|
|
|
switchInt(move _17) -> [0: bb6, otherwise: bb5];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb5: {
|
|
|
|
StorageDead(_19);
|
|
|
|
StorageDead(_18);
|
2023-09-16 17:13:30 +00:00
|
|
|
_7 = const ();
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_17);
|
2023-09-16 09:35:46 +00:00
|
|
|
StorageDead(_16);
|
|
|
|
StorageDead(_15);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_13);
|
|
|
|
StorageDead(_10);
|
|
|
|
StorageDead(_8);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageDead(_7);
|
2023-09-23 07:56:59 +00:00
|
|
|
- StorageLive(_29);
|
2023-09-16 17:13:30 +00:00
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_30);
|
|
|
|
_30 = &(*_1);
|
|
|
|
_29 = move _30 as &[u8] (Transmute);
|
|
|
|
StorageDead(_30);
|
|
|
|
StorageLive(_31);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageLive(_32);
|
|
|
|
_32 = _29;
|
2023-09-23 07:56:59 +00:00
|
|
|
- _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind unreachable];
|
|
|
|
+ _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind unreachable];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb6: {
|
|
|
|
StorageDead(_19);
|
|
|
|
StorageDead(_18);
|
|
|
|
- StorageLive(_21);
|
2023-09-19 20:12:48 +00:00
|
|
|
- _21 = core::panicking::AssertKind::Eq;
|
2023-09-16 17:13:30 +00:00
|
|
|
+ nop;
|
2023-09-19 20:12:48 +00:00
|
|
|
+ _21 = const core::panicking::AssertKind::Eq;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_22);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageLive(_23);
|
2023-09-23 07:56:59 +00:00
|
|
|
- _23 = move _21;
|
2023-09-19 20:12:48 +00:00
|
|
|
+ _23 = const core::panicking::AssertKind::Eq;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_24);
|
2023-09-16 09:16:04 +00:00
|
|
|
- StorageLive(_25);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _25 = &(*_15);
|
2023-09-16 09:16:04 +00:00
|
|
|
+ nop;
|
2023-09-16 09:35:46 +00:00
|
|
|
+ _25 = &(*_9);
|
2023-09-23 07:56:59 +00:00
|
|
|
_24 = &(*_25);
|
|
|
|
StorageLive(_26);
|
2023-09-16 09:16:04 +00:00
|
|
|
- StorageLive(_27);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _27 = &(*_16);
|
2023-09-16 09:16:04 +00:00
|
|
|
+ nop;
|
2023-09-16 09:35:46 +00:00
|
|
|
+ _27 = &(*_12);
|
2023-09-23 07:56:59 +00:00
|
|
|
_26 = &(*_27);
|
|
|
|
StorageLive(_28);
|
|
|
|
_28 = Option::<Arguments<'_>>::None;
|
2023-10-14 12:12:54 +00:00
|
|
|
- _22 = assert_failed::<*const u8, *const u8>(move _23, move _24, move _26, move _28) -> unwind unreachable;
|
|
|
|
+ _22 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, move _28) -> unwind unreachable;
|
2023-09-23 07:56:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb7: {
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageDead(_32);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_31);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageLive(_33);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_34);
|
2023-09-16 09:35:46 +00:00
|
|
|
- StorageLive(_35);
|
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_36);
|
|
|
|
StorageLive(_37);
|
|
|
|
_37 = &(*_1);
|
|
|
|
_36 = core::str::<impl str>::as_ptr(move _37) -> [return: bb8, unwind unreachable];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb8: {
|
|
|
|
StorageDead(_37);
|
|
|
|
_35 = &_36;
|
2023-09-16 09:35:46 +00:00
|
|
|
- StorageLive(_38);
|
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_39);
|
|
|
|
StorageLive(_40);
|
|
|
|
_40 = &(*_29);
|
|
|
|
_39 = core::slice::<impl [u8]>::as_ptr(move _40) -> [return: bb9, unwind unreachable];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb9: {
|
|
|
|
StorageDead(_40);
|
|
|
|
_38 = &_39;
|
2023-09-16 09:35:46 +00:00
|
|
|
- _34 = (move _35, move _38);
|
|
|
|
- StorageDead(_38);
|
|
|
|
- StorageDead(_35);
|
|
|
|
+ _34 = (_35, _38);
|
2023-09-16 09:16:04 +00:00
|
|
|
+ nop;
|
|
|
|
+ nop;
|
2023-09-16 09:35:46 +00:00
|
|
|
StorageLive(_41);
|
|
|
|
- _41 = (_34.0: &*const u8);
|
|
|
|
+ _41 = _35;
|
|
|
|
StorageLive(_42);
|
|
|
|
- _42 = (_34.1: &*const u8);
|
|
|
|
+ _42 = _38;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_43);
|
|
|
|
StorageLive(_44);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _44 = (*_41);
|
|
|
|
+ _44 = (*_35);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_45);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _45 = (*_42);
|
|
|
|
+ _45 = (*_38);
|
2023-09-23 07:56:59 +00:00
|
|
|
_43 = Eq(move _44, move _45);
|
|
|
|
switchInt(move _43) -> [0: bb11, otherwise: bb10];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb10: {
|
|
|
|
StorageDead(_45);
|
|
|
|
StorageDead(_44);
|
2023-09-16 17:13:30 +00:00
|
|
|
_33 = const ();
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_43);
|
2023-09-16 09:35:46 +00:00
|
|
|
StorageDead(_42);
|
|
|
|
StorageDead(_41);
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_39);
|
|
|
|
StorageDead(_36);
|
|
|
|
StorageDead(_34);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageDead(_33);
|
2023-09-23 07:56:59 +00:00
|
|
|
_0 = const ();
|
|
|
|
- StorageDead(_29);
|
2023-09-16 17:13:30 +00:00
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageDead(_4);
|
|
|
|
- StorageDead(_1);
|
2023-09-16 17:13:30 +00:00
|
|
|
+ nop;
|
2023-09-23 07:56:59 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb11: {
|
|
|
|
StorageDead(_45);
|
|
|
|
StorageDead(_44);
|
|
|
|
- StorageLive(_47);
|
2023-09-19 20:12:48 +00:00
|
|
|
- _47 = core::panicking::AssertKind::Eq;
|
2023-09-16 17:13:30 +00:00
|
|
|
+ nop;
|
2023-09-19 20:12:48 +00:00
|
|
|
+ _47 = const core::panicking::AssertKind::Eq;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_48);
|
2023-09-16 17:13:30 +00:00
|
|
|
StorageLive(_49);
|
2023-09-23 07:56:59 +00:00
|
|
|
- _49 = move _47;
|
2023-09-19 20:12:48 +00:00
|
|
|
+ _49 = const core::panicking::AssertKind::Eq;
|
2023-09-23 07:56:59 +00:00
|
|
|
StorageLive(_50);
|
2023-09-16 09:16:04 +00:00
|
|
|
- StorageLive(_51);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _51 = &(*_41);
|
2023-09-16 09:16:04 +00:00
|
|
|
+ nop;
|
2023-09-16 09:35:46 +00:00
|
|
|
+ _51 = &(*_35);
|
2023-09-23 07:56:59 +00:00
|
|
|
_50 = &(*_51);
|
|
|
|
StorageLive(_52);
|
2023-09-16 09:16:04 +00:00
|
|
|
- StorageLive(_53);
|
2023-09-16 09:35:46 +00:00
|
|
|
- _53 = &(*_42);
|
2023-09-16 09:16:04 +00:00
|
|
|
+ nop;
|
2023-09-16 09:35:46 +00:00
|
|
|
+ _53 = &(*_38);
|
2023-09-23 07:56:59 +00:00
|
|
|
_52 = &(*_53);
|
|
|
|
StorageLive(_54);
|
|
|
|
_54 = Option::<Arguments<'_>>::None;
|
2023-10-14 12:12:54 +00:00
|
|
|
- _48 = assert_failed::<*const u8, *const u8>(move _49, move _50, move _52, move _54) -> unwind unreachable;
|
|
|
|
+ _48 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, move _54) -> unwind unreachable;
|
2023-09-23 07:56:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|