rust/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs

20 lines
344 B
Rust

//@ 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() {}