rust/tests/ui/error-codes/E0509.rs
2023-01-11 09:32:08 +00:00

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);
}