fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
547 B16 linesraw
1error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
2  --> $DIR/borrow-immutable-upvar-mutation-impl-trait.rs:11:9
3   |
4LL |   fn bar() -> impl Fn() -> usize {
5   |      ---      ------------------ change this to return `FnMut` instead of `Fn`
6LL |       let mut x = 0;
7LL | /     move || {
8LL | |         x += 1;
9   | |         ^^^^^^ cannot assign
10LL | |         x
11LL | |     }
12   | |_____- in this closure
13
14error: aborting due to previous error
15
16For more information about this error, try `rustc --explain E0594`.