summaryrefslogtreecommitdiffstats
path: root/tests/ui/confuse-field-and-method/issue-32128.rs
blob: 5a024aa4b67492d7fde0c0eaf930a8e0f4424b48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
}