fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
796 B23 linesraw
1error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
2  --> $DIR/issue-61452.rs:4:5
3   |
4LL | pub async fn f(x: Option<usize>) {
5   |                - help: consider changing this to be mutable: `mut x`
6LL |     x.take();
7   |     ^ cannot borrow as mutable
8
9error[E0384]: cannot assign twice to immutable variable `x`
10  --> $DIR/issue-61452.rs:9:5
11   |
12LL | pub async fn g(x: usize) {
13   |                -
14   |                |
15   |                first assignment to `x`
16   |                help: make this binding mutable: `mut x`
17LL |     x += 1;
18   |     ^^^^^^ cannot assign twice to immutable variable
19
20error: aborting due to 2 previous errors
21
22Some errors have detailed explanations: E0384, E0596.
23For more information about an error, try `rustc --explain E0384`.