mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
19 lines
314 B
Rust
19 lines
314 B
Rust
struct FancyNum {
|
|
num: usize
|
|
}
|
|
|
|
struct DropStruct {
|
|
fancy: FancyNum
|
|
}
|
|
|
|
impl Drop for DropStruct {
|
|
fn drop(&mut self) {
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let drop_struct = DropStruct{fancy: FancyNum{num: 5}};
|
|
let fancy_field = drop_struct.fancy; //~ ERROR E0509
|
|
println!("Fancy: {}", fancy_field.num);
|
|
}
|