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