]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-57989.stderr
Rollup merge of #103146 - joboet:cleanup_pthread_condvar, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / issue-57989.stderr
1 error[E0594]: cannot assign to `*x`, which is behind a `&` reference
2   --> $DIR/issue-57989.rs:5:5
3    |
4 LL | fn f(x: &i32) {
5    |         ---- help: consider changing this to be a mutable reference: `&mut i32`
6 LL |     let g = &x;
7 LL |     *x = 0;
8    |     ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
9
10 error[E0506]: cannot assign to `*x` because it is borrowed
11   --> $DIR/issue-57989.rs:5:5
12    |
13 LL |     let g = &x;
14    |             -- borrow of `*x` occurs here
15 LL |     *x = 0;
16    |     ^^^^^^ assignment to borrowed `*x` occurs here
17 LL |
18 LL |     g;
19    |     - borrow later used here
20
21 error: aborting due to 2 previous errors
22
23 Some errors have detailed explanations: E0506, E0594.
24 For more information about an error, try `rustc --explain E0506`.