2020-09-16 15:19:45 -05:00
|
|
|
#![stable(feature = "core", since = "1.6.0")]
|
|
|
|
#![feature(staged_api)]
|
2021-04-26 07:53:41 -05:00
|
|
|
#![feature(const_precise_live_drops)]
|
2020-09-16 15:19:45 -05:00
|
|
|
|
|
|
|
enum Either<T, S> {
|
|
|
|
Left(T),
|
|
|
|
Right(S),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Either<T, T> {
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
#[rustc_const_stable(feature = "foo", since = "1.0.0")]
|
|
|
|
pub const fn unwrap(self) -> T {
|
2022-09-23 09:22:36 -05:00
|
|
|
//~^ ERROR destructor of
|
2020-09-16 15:19:45 -05:00
|
|
|
match self {
|
|
|
|
Self::Left(t) => t,
|
|
|
|
Self::Right(t) => t,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|