about summary refs log tree commit diff
path: root/tests/ui/ergonomic-clones/closure/mutation2.rs
blob: 1cb5b8a7ec3f627f7319dd8d52532bbb8a6dc560 (plain)
1
2
3
4
5
6
7
8
9
10
11
#![feature(ergonomic_clones)]
#![allow(incomplete_features)]

fn main() {
    let mut my_var = false;
    let callback = use || {
        my_var = true;
    };
    callback();
    //~^ ERROR cannot borrow `callback` as mutable, as it is not declared as mutable [E0596]
}