rust/tests/mir-opt/issue_99325.main.built.after.mir
2023-07-14 13:27:35 +01:00

273 lines
6.9 KiB
Rust

// MIR for `main` after built
| User Type Annotations
| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserArgs { args: [Const { ty: &'static [u8; 4], kind: Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)]) }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserArgs { args: [Const { ty: &'static [u8; 4], kind: UnevaluatedConst { def: DefId(0:8 ~ issue_99325[22bb]::main::{constant#1}), args: [] } }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
|
fn main() -> () {
let mut _0: ();
let _1: ();
let mut _2: (&&[u8], &&[u8; 4]);
let mut _3: &&[u8];
let _4: &[u8];
let mut _5: &&[u8; 4];
let _6: &[u8; 4];
let _7: [u8; 4];
let _8: &&[u8];
let _9: &&[u8; 4];
let mut _10: bool;
let mut _11: bool;
let mut _12: &&[u8];
let mut _13: &&[u8; 4];
let mut _14: !;
let _16: !;
let mut _17: core::panicking::AssertKind;
let mut _18: &&[u8];
let _19: &&[u8];
let mut _20: &&[u8; 4];
let _21: &&[u8; 4];
let mut _22: std::option::Option<std::fmt::Arguments<'_>>;
let _23: ();
let mut _24: (&&[u8], &&[u8; 4]);
let mut _25: &&[u8];
let _26: &[u8];
let mut _27: &&[u8; 4];
let _28: &[u8; 4];
let _29: &&[u8];
let _30: &&[u8; 4];
let mut _31: bool;
let mut _32: bool;
let mut _33: &&[u8];
let mut _34: &&[u8; 4];
let mut _35: !;
let _37: !;
let mut _38: core::panicking::AssertKind;
let mut _39: &&[u8];
let _40: &&[u8];
let mut _41: &&[u8; 4];
let _42: &&[u8; 4];
let mut _43: std::option::Option<std::fmt::Arguments<'_>>;
scope 1 {
debug left_val => _8;
debug right_val => _9;
let _15: core::panicking::AssertKind;
scope 2 {
debug kind => _15;
}
}
scope 3 {
debug left_val => _29;
debug right_val => _30;
let _36: core::panicking::AssertKind;
scope 4 {
debug kind => _36;
}
}
bb0: {
StorageLive(_1);
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
_4 = function_with_bytes::<&*b"AAAA">() -> [return: bb1, unwind: bb19];
}
bb1: {
_3 = &_4;
StorageLive(_5);
StorageLive(_6);
StorageLive(_7);
_7 = [const 65_u8, const 65_u8, const 65_u8, const 65_u8];
_6 = &_7;
_5 = &_6;
_2 = (move _3, move _5);
StorageDead(_5);
StorageDead(_3);
FakeRead(ForMatchedPlace(None), _2);
StorageLive(_8);
_8 = (_2.0: &&[u8]);
StorageLive(_9);
_9 = (_2.1: &&[u8; 4]);
StorageLive(_10);
StorageLive(_11);
StorageLive(_12);
_12 = &(*_8);
StorageLive(_13);
_13 = &(*_9);
_11 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _12, move _13) -> [return: bb2, unwind: bb19];
}
bb2: {
StorageDead(_13);
StorageDead(_12);
_10 = Not(move _11);
StorageDead(_11);
switchInt(move _10) -> [0: bb4, otherwise: bb3];
}
bb3: {
StorageLive(_15);
_15 = core::panicking::AssertKind::Eq;
FakeRead(ForLet(None), _15);
StorageLive(_16);
StorageLive(_17);
_17 = move _15;
StorageLive(_18);
StorageLive(_19);
_19 = &(*_8);
_18 = &(*_19);
StorageLive(_20);
StorageLive(_21);
_21 = &(*_9);
_20 = &(*_21);
StorageLive(_22);
_22 = Option::<Arguments<'_>>::None;
_16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19;
}
bb4: {
goto -> bb7;
}
bb5: {
StorageDead(_22);
StorageDead(_20);
StorageDead(_18);
StorageDead(_17);
StorageDead(_21);
StorageDead(_19);
StorageDead(_16);
StorageDead(_15);
unreachable;
}
bb6: {
goto -> bb8;
}
bb7: {
_1 = const ();
goto -> bb8;
}
bb8: {
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
goto -> bb9;
}
bb9: {
StorageDead(_7);
StorageDead(_6);
StorageDead(_4);
StorageDead(_2);
StorageDead(_1);
StorageLive(_23);
StorageLive(_24);
StorageLive(_25);
StorageLive(_26);
_26 = function_with_bytes::<&*b"AAAA">() -> [return: bb10, unwind: bb19];
}
bb10: {
_25 = &_26;
StorageLive(_27);
StorageLive(_28);
_28 = const b"AAAA";
_27 = &_28;
_24 = (move _25, move _27);
StorageDead(_27);
StorageDead(_25);
FakeRead(ForMatchedPlace(None), _24);
StorageLive(_29);
_29 = (_24.0: &&[u8]);
StorageLive(_30);
_30 = (_24.1: &&[u8; 4]);
StorageLive(_31);
StorageLive(_32);
StorageLive(_33);
_33 = &(*_29);
StorageLive(_34);
_34 = &(*_30);
_32 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _33, move _34) -> [return: bb11, unwind: bb19];
}
bb11: {
StorageDead(_34);
StorageDead(_33);
_31 = Not(move _32);
StorageDead(_32);
switchInt(move _31) -> [0: bb13, otherwise: bb12];
}
bb12: {
StorageLive(_36);
_36 = core::panicking::AssertKind::Eq;
FakeRead(ForLet(None), _36);
StorageLive(_37);
StorageLive(_38);
_38 = move _36;
StorageLive(_39);
StorageLive(_40);
_40 = &(*_29);
_39 = &(*_40);
StorageLive(_41);
StorageLive(_42);
_42 = &(*_30);
_41 = &(*_42);
StorageLive(_43);
_43 = Option::<Arguments<'_>>::None;
_37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19;
}
bb13: {
goto -> bb16;
}
bb14: {
StorageDead(_43);
StorageDead(_41);
StorageDead(_39);
StorageDead(_38);
StorageDead(_42);
StorageDead(_40);
StorageDead(_37);
StorageDead(_36);
unreachable;
}
bb15: {
goto -> bb17;
}
bb16: {
_23 = const ();
goto -> bb17;
}
bb17: {
StorageDead(_31);
StorageDead(_30);
StorageDead(_29);
goto -> bb18;
}
bb18: {
StorageDead(_28);
StorageDead(_26);
StorageDead(_24);
StorageDead(_23);
_0 = const ();
return;
}
bb19 (cleanup): {
resume;
}
}
alloc4 (size: 4, align: 1) {
41 41 41 41 AAAA
}