diff options
Diffstat (limited to 'tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs')
-rw-r--r-- | tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs b/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs new file mode 100644 index 000000000..7c2d68cce --- /dev/null +++ b/tests/ui/type-alias-impl-trait/destructure_tait-ice-113594.rs @@ -0,0 +1,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() {} |