2020-09-16 13:19:45 -07:00
|
|
|
#![stable(feature = "core", since = "1.6.0")]
|
|
|
|
#![feature(staged_api)]
|
2021-04-26 14:53:41 +02:00
|
|
|
#![feature(const_precise_live_drops)]
|
2020-09-16 13:19:45 -07: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 14:22:36 +00:00
|
|
|
//~^ ERROR destructor of
|
2020-09-16 13:19:45 -07:00
|
|
|
match self {
|
|
|
|
Self::Left(t) => t,
|
|
|
|
Self::Right(t) => t,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|