diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir')
-rw-r--r-- | tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir new file mode 100644 index 000000000..086955236 --- /dev/null +++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir @@ -0,0 +1,38 @@ +// MIR for `unwrap` after SimplifyCfg-elaborate-drops + +fn unwrap(_1: Option<T>) -> T { + debug opt => _1; + let mut _0: T; + let mut _2: isize; + let _3: T; + let mut _4: !; + let mut _5: isize; + let mut _6: isize; + let mut _7: isize; + scope 1 { + debug x => _3; + } + + bb0: { + _2 = discriminant(_1); + switchInt(move _2) -> [0: bb1, 1: bb3, otherwise: bb2]; + } + + bb1: { + StorageLive(_4); + _4 = begin_panic::<&str>(const "explicit panic") -> unwind unreachable; + } + + bb2: { + unreachable; + } + + bb3: { + StorageLive(_3); + _3 = move ((_1 as Some).0: T); + _0 = move _3; + StorageDead(_3); + _5 = discriminant(_1); + return; + } +} |