]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-61452.stderr
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
[rust.git] / tests / ui / async-await / issue-61452.stderr
1 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
2   --> $DIR/issue-61452.rs:4:5
3    |
4 LL |     x.take();
5    |     ^^^^^^^^ cannot borrow as mutable
6    |
7 help: consider changing this to be mutable
8    |
9 LL | pub async fn f(mut x: Option<usize>) {
10    |                +++
11
12 error[E0384]: cannot assign twice to immutable variable `x`
13   --> $DIR/issue-61452.rs:9:5
14    |
15 LL | pub async fn g(x: usize) {
16    |                -
17    |                |
18    |                first assignment to `x`
19    |                help: consider making this binding mutable: `mut x`
20 LL |     x += 1;
21    |     ^^^^^^ cannot assign twice to immutable variable
22
23 error: aborting due to 2 previous errors
24
25 Some errors have detailed explanations: E0384, E0596.
26 For more information about an error, try `rustc --explain E0384`.