phd/assets/dash-3d-implementation/undefined-behaviour-error.txt

11 lines
378 B
Plaintext
Raw Normal View History

2019-09-25 17:18:35 +02:00
error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable
--> src/main.rs:4:9
|
3 | for value in &vec {
| ----
| |
| immutable borrow occurs here
| immutable borrow later used here
4 | vec.push(*value);
| ^^^^^^^^^^^^^^^^ mutable borrow occurs here