2023-02-24 15:33:22 -06:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-03-22 07:00:12 -05:00
|
|
|
//@ compile-flags: -Zmir-opt-level=2 -Zinline-mir
|
2023-02-24 15:33:22 -06:00
|
|
|
|
|
|
|
// 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 {
|
2023-10-21 00:22:32 -05:00
|
|
|
// CHECK-LABEL: fn unwrap_unchecked(
|
|
|
|
// CHECK: (inlined #[track_caller] Option::<T>::unwrap_unchecked)
|
2023-02-24 15:33:22 -06:00
|
|
|
slf.unwrap_unchecked()
|
|
|
|
}
|