2018-01-15 13:27:58 -08:00
|
|
|
pub fn bar<F: Fn()>(_f: F) {}
|
|
|
|
|
|
|
|
pub fn foo() {
|
|
|
|
let mut x = 0;
|
|
|
|
bar(move || x = 1);
|
2019-04-22 08:40:08 +01:00
|
|
|
//~^ ERROR cannot assign to `x`, as it is a captured variable in a `Fn` closure
|
|
|
|
//~| NOTE cannot assign
|
|
|
|
//~| HELP consider changing this to accept closures that implement `FnMut`
|
2018-01-15 13:27:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|