]> git.lizzy.rs Git - rust.git/blob - tests/ui/hashmap/hashmap-iter-value-lifetime.stderr
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / hashmap / 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();
8    |     ^^^^^^^^^^^^^^^^ mutable borrow occurs here
9 LL |
10 LL |     println!("{}", *thing);
11    |                    ------ immutable borrow later used here
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0502`.