]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-insert-during-each.stderr
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / borrowck / borrowck-insert-during-each.stderr
1 error[E0501]: cannot borrow `*f` as mutable because previous closure requires unique access
2   --> $DIR/borrowck-insert-during-each.rs:16:5
3    |
4 LL |       f.foo(
5    |       ^ --- first borrow later used by call
6    |  _____|
7    | |
8 LL | |
9 LL | |         |a| {
10    | |         --- closure construction occurs here
11 LL | |             f.n.insert(*a);
12    | |             --- first borrow occurs due to use of `f` in closure
13 LL | |         })
14    | |__________^ second borrow occurs here
15
16 error[E0500]: closure requires unique access to `f` but it is already borrowed
17   --> $DIR/borrowck-insert-during-each.rs:18:9
18    |
19 LL |       f.foo(
20    |       - --- first borrow later used by call
21    |  _____|
22    | |
23 LL | |
24 LL | |         |a| {
25    | |         ^^^ closure construction occurs here
26 LL | |             f.n.insert(*a);
27    | |             --- second borrow occurs due to use of `f` in closure
28 LL | |         })
29    | |__________- borrow occurs here
30
31 error: aborting due to 2 previous errors
32
33 Some errors have detailed explanations: E0500, E0501.
34 For more information about an error, try `rustc --explain E0500`.