rust/tests/mir-opt/inline/unwrap_unchecked.rs
2023-03-18 14:29:13 -04:00

11 lines
363 B
Rust

#![crate_type = "lib"]
// 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()
}