about summary refs log tree commit diff
path: root/tests/ui/lint/let_underscore/issue-119697-extra-let.rs
blob: 9782b3191fd68f26a162cda656171b4511e12d26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![deny(let_underscore_drop)]
#![feature(type_alias_impl_trait)]

pub struct Foo {
    /// This type must have nontrivial drop glue
    field: String,
}

pub type Tait = impl Sized;

#[define_opaque(Tait)]
pub fn ice_cold(beverage: Tait) {
    // Must destructure at least one field of `Foo`
    let Foo { field } = beverage;
    // boom
    _ = field; //~ ERROR non-binding let on a type that has a destructor

    let _ = field; //~ ERROR non-binding let on a type that has a destructor
}

pub fn main() {}