diff options
Diffstat (limited to 'tests/mir-opt/inline/unwrap_unchecked.rs')
-rw-r--r-- | tests/mir-opt/inline/unwrap_unchecked.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/mir-opt/inline/unwrap_unchecked.rs b/tests/mir-opt/inline/unwrap_unchecked.rs new file mode 100644 index 000000000..5856f1479 --- /dev/null +++ b/tests/mir-opt/inline/unwrap_unchecked.rs @@ -0,0 +1,11 @@ +#![crate_type = "lib"] + +// ignore-wasm32-bare compiled with panic=abort by default +// ignore-debug: the debug assertions prevent the inlining we are testing for +// compile-flags: -Zmir-opt-level=2 -Zinline-mir + +// EMIT_MIR unwrap_unchecked.unwrap_unchecked.Inline.diff +// EMIT_MIR unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir +pub unsafe fn unwrap_unchecked<T>(slf: Option<T>) -> T { + slf.unwrap_unchecked() +} |