rust/tests/ui/error-codes/E0509.rs

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