Files
rust/tests/ui/structs/destructuring-struct-with-dtor-6344.rs

17 lines
266 B
Rust
Raw Normal View History

2025-08-20 14:02:39 -04:00
// https://github.com/rust-lang/rust/issues/6344
//@ run-pass
#![allow(non_shorthand_field_patterns)]
struct A { x: usize }
impl Drop for A {
2013-09-16 21:18:07 -04:00
fn drop(&mut self) {}
}
pub fn main() {
let a = A { x: 0 };
let A { x: ref x } = a;
2014-10-14 21:07:11 -04:00
println!("{}", x)
}