fork/rust

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

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

master
770 B26 linesraw
1error[E0594]: cannot assign to `*x`, which is behind a `&` reference
2  --> $DIR/issue-57989.rs:5:5
3   |
4LL |     *x = 0;
5   |     ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
6   |
7help: consider changing this to be a mutable reference
8   |
9LL | fn f(x: &mut i32) {
10   |          +++
11
12error[E0506]: cannot assign to `*x` because it is borrowed
13  --> $DIR/issue-57989.rs:5:5
14   |
15LL |     let g = &x;
16   |             -- `*x` is borrowed here
17LL |     *x = 0;
18   |     ^^^^^^ `*x` is assigned to here but it was already borrowed
19LL |
20LL |     g;
21   |     - borrow later used here
22
23error: aborting due to 2 previous errors
24
25Some errors have detailed explanations: E0506, E0594.
26For more information about an error, try `rustc --explain E0506`.