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