mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
16 lines
217 B
Rust
16 lines
217 B
Rust
//@ run-pass
|
|
#![allow(non_shorthand_field_patterns)]
|
|
|
|
struct A { x: usize }
|
|
|
|
impl Drop for A {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
pub fn main() {
|
|
let a = A { x: 0 };
|
|
|
|
let A { x: ref x } = a;
|
|
println!("{}", x)
|
|
}
|