]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hashmap-iter-value-lifetime.stderr
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / hashmap-iter-value-lifetime.stderr
1 error[E0502]: cannot borrow `my_stuff` as mutable because it is also borrowed as immutable
2   --> $DIR/hashmap-iter-value-lifetime.rs:7:5
3    |
4 LL |     let (_, thing) = my_stuff.iter().next().unwrap();
5    |                      -------- immutable borrow occurs here
6 LL | 
7 LL |     my_stuff.clear(); //~ ERROR cannot borrow
8    |     ^^^^^^^^ mutable borrow occurs here
9 ...
10 LL | }
11    | - immutable borrow ends here
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0502`.