]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-18783.stderr
Auto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrz
[rust.git] / src / test / ui / issues / issue-18783.stderr
1 error[E0499]: cannot borrow `y` as mutable more than once at a time
2   --> $DIR/issue-18783.rs:17:21
3    |
4 LL |     c.push(Box::new(|| y = 0));
5    |                     -- - previous borrow occurs due to use of `y` in closure
6    |                     |
7    |                     first mutable borrow occurs here
8 LL |     c.push(Box::new(|| y = 0));
9    |                     ^^ - borrow occurs due to use of `y` in closure
10    |                     |
11    |                     second mutable borrow occurs here
12 LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time
13 LL | }
14    | - first borrow ends here
15
16 error[E0499]: cannot borrow `y` as mutable more than once at a time
17   --> $DIR/issue-18783.rs:26:29
18    |
19 LL |     Push::push(&c, Box::new(|| y = 0));
20    |                             -- - previous borrow occurs due to use of `y` in closure
21    |                             |
22    |                             first mutable borrow occurs here
23 LL |     Push::push(&c, Box::new(|| y = 0));
24    |                             ^^ - borrow occurs due to use of `y` in closure
25    |                             |
26    |                             second mutable borrow occurs here
27 LL | //~^ ERROR cannot borrow `y` as mutable more than once at a time
28 LL | }
29    | - first borrow ends here
30
31 error: aborting due to 2 previous errors
32
33 For more information about this error, try `rustc --explain E0499`.