]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/promoted-const-drop.rs
Do not suggest `let_else` if no bindings would be introduced
[rust.git] / src / test / ui / consts / promoted-const-drop.rs
1 #![feature(const_trait_impl)]
2 #![feature(const_mut_refs)]
3
4 struct A();
5
6 impl const Drop for A {
7     fn drop(&mut self) {}
8 }
9
10 const C: A = A();
11
12 fn main() {
13     let _: &'static A = &A(); //~ ERROR temporary value dropped while borrowed
14     let _: &'static [A] = &[C]; //~ ERROR temporary value dropped while borrowed
15 }