rust/tests/ui/confuse-field-and-method/issue-32128.rs
2023-01-11 09:32:08 +00:00

16 lines
253 B
Rust

struct Example {
example: Box<dyn Fn(i32) -> i32>
}
fn main() {
let demo = Example {
example: Box::new(|x| {
x + 1
})
};
demo.example(1);
//~^ ERROR no method named `example`
// (demo.example)(1);
}