]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/stable-precise-live-drops-in-libcore.rs
Do not suggest `let_else` if no bindings would be introduced
[rust.git] / src / test / ui / consts / stable-precise-live-drops-in-libcore.rs
1 #![stable(feature = "core", since = "1.6.0")]
2 #![feature(staged_api)]
3 #![feature(const_precise_live_drops)]
4
5 enum Either<T, S> {
6     Left(T),
7     Right(S),
8 }
9
10 impl<T> Either<T, T> {
11     #[stable(feature = "rust1", since = "1.0.0")]
12     #[rustc_const_stable(feature = "foo", since = "1.0.0")]
13     pub const fn unwrap(self) -> T {
14         //~^ ERROR destructors cannot be evaluated at compile-time
15         match self {
16             Self::Left(t) => t,
17             Self::Right(t) => t,
18         }
19     }
20 }
21
22 fn main() {}