summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs
blob: 7c2d68cceb8fcbad3c6c5f8ee2c2c2109354c80b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// build-pass
// edition: 2021

#![feature(type_alias_impl_trait)]

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

pub type Tait = impl Sized;

pub async fn ice_cold(beverage: Tait) {
    // Must destructure at least one field of `Foo`
    let Foo { field } = beverage;
    _ = field;
}

fn main() {}