`Result::unwrap` is not eligible becuase it formats the contents of the
`Err` variant. `unwrap_or`, `unwrap_or_else` and friends are not
eligible because they drop things or invoke closures.
#![feature(const_fn_union)]
#![feature(const_generics)]
#![feature(const_option)]
+#![feature(const_precise_live_drops)]
#![feature(const_ptr_offset)]
#![feature(const_ptr_offset_from)]
#![feature(const_raw_ptr_comparison)]
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
- pub fn unwrap(self) -> T {
+ #[rustc_const_unstable(feature = "const_option", issue = "67441")]
+ pub const fn unwrap(self) -> T {
match self {
Some(val) => val,
None => panic!("called `Option::unwrap()` on a `None` value"),