mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
18 lines
314 B
Rust
18 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);
|
|
}
|