]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/dont-print-desugared.stderr
Rollup merge of #103146 - joboet:cleanup_pthread_condvar, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / dont-print-desugared.stderr
1 error[E0596]: cannot borrow data in a `&` reference as mutable
2   --> $DIR/dont-print-desugared.rs:4:10
3    |
4 LL |     for &ref mut x in s {}
5    |          ^^^^^^^^^ cannot borrow as mutable
6
7 error[E0597]: `y` does not live long enough
8   --> $DIR/dont-print-desugared.rs:17:16
9    |
10 LL |     for ref mut d in v {
11    |                      - a temporary with access to the borrow is created here ...
12 LL |         let y = ();
13 LL |         *d = D(&y);
14    |                ^^ borrowed value does not live long enough
15 LL |     }
16    |     -
17    |     |
18    |     `y` dropped here while still borrowed
19    |     ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
20
21 error: aborting due to 2 previous errors
22
23 Some errors have detailed explanations: E0596, E0597.
24 For more information about an error, try `rustc --explain E0596`.