2024-01-07 11:15:02 -06: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-25 21:18:18 -05:00
|
|
|
_ = field; //~ ERROR non-binding let on a type that has a destructor
|
2024-01-07 11:15:02 -06:00
|
|
|
|
2024-09-25 21:18:18 -05:00
|
|
|
let _ = field; //~ ERROR non-binding let on a type that has a destructor
|
2024-01-07 11:15:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn main() {}
|