]>
Commit | Line | Data |
---|---|---|
54a0048b | 1 | struct Example { |
dc9dc135 | 2 | example: Box<dyn Fn(i32) -> i32> |
223e47cc LB |
3 | } |
4 | ||
5 | fn main() { | |
54a0048b SL |
6 | let demo = Example { |
7 | example: Box::new(|x| { | |
8 | x + 1 | |
9 | }) | |
10 | }; | |
11 | ||
cc61c64b XL |
12 | demo.example(1); |
13 | //~^ ERROR no method named `example` | |
54a0048b | 14 | // (demo.example)(1); |
223e47cc | 15 | } |