2024-01-08 01:15:02 +08:00
|
|
|
#![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;
|
|
|
|
|
|
|
|
|
|
pub fn ice_cold(beverage: Tait) {
|
|
|
|
|
// Must destructure at least one field of `Foo`
|
|
|
|
|
let Foo { field } = beverage;
|
|
|
|
|
// boom
|
2024-09-26 10:18:18 +08:00
|
|
|
_ = field; //~ ERROR non-binding let on a type that has a destructor
|
2024-01-08 01:15:02 +08:00
|
|
|
|
2024-09-26 10:18:18 +08:00
|
|
|
let _ = field; //~ ERROR non-binding let on a type that has a destructor
|
2024-01-08 01:15:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn main() {}
|