fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
880 B25 linesraw
1error[E0384]: cannot assign twice to immutable variable `x`
2  --> $DIR/mut-pattern-internal-mutability.rs:5:5
3   |
4LL |     let &mut x = foo;
5   |              -
6   |              |
7   |              first assignment to `x`
8   |              help: consider making this binding mutable: `mut x`
9LL |     x += 1;
10   |     ^^^^^^ cannot assign twice to immutable variable
11
12error[E0506]: cannot assign to `*foo` because it is borrowed
13  --> $DIR/mut-pattern-internal-mutability.rs:13:5
14   |
15LL |     let &mut ref x = foo;
16   |              ----- `*foo` is borrowed here
17LL |     *foo += 1;
18   |     ^^^^^^^^^ `*foo` is assigned to here but it was already borrowed
19LL |     drop(x);
20   |          - borrow later used here
21
22error: aborting due to 2 previous errors
23
24Some errors have detailed explanations: E0384, E0506.
25For more information about an error, try `rustc --explain E0384`.