]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-closures-mut-of-mut.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-closures-mut-of-mut.stderr
1 error[E0524]: two closures require unique access to `x` at the same time
2   --> $DIR/borrowck-closures-mut-of-mut.rs:14:18
3    |
4 LL |     let mut c1 = || set(&mut *x);
5    |                  --          -- first borrow occurs due to use of `x` in closure
6    |                  |
7    |                  first closure is constructed here
8 LL |     let mut c2 = || set(&mut *x);
9    |                  ^^          -- second borrow occurs due to use of `x` in closure
10    |                  |
11    |                  second closure is constructed here
12 LL |
13 LL |     c2(); c1();
14    |           -- first borrow later used here
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0524`.