]> git.lizzy.rs Git - rust.git/blob - src/test/ui/cannot-mutate-captured-non-mut-var.ast.stderr
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / cannot-mutate-captured-non-mut-var.ast.stderr
1 error[E0594]: cannot assign to immutable captured outer variable in an `FnOnce` closure `x`
2   --> $DIR/cannot-mutate-captured-non-mut-var.rs:13:25
3    |
4 LL |     to_fn_once(move|| { x = 2; });
5    |                         ^^^^^
6
7 error[E0596]: cannot borrow immutable captured outer variable in an `FnOnce` closure `s` as mutable
8   --> $DIR/cannot-mutate-captured-non-mut-var.rs:18:25
9    |
10 LL |     to_fn_once(move|| { s.read_to_end(&mut Vec::new()); });
11    |                         ^
12
13 error: aborting due to 2 previous errors
14
15 Some errors occurred: E0594, E0596.
16 For more information about an error, try `rustc --explain E0594`.