]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-18783.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / issues / issue-18783.stderr
CommitLineData
8faf50e0 1error[E0499]: cannot borrow `y` as mutable more than once at a time
0731742a 2 --> $DIR/issue-18783.rs:7:21
8faf50e0
XL
3 |
4LL | c.push(Box::new(|| y = 0));
48663c56 5 | -- - first borrow occurs due to use of `y` in closure
8faf50e0
XL
6 | |
7 | first mutable borrow occurs here
8LL | c.push(Box::new(|| y = 0));
48663c56 9 | ^^ - second borrow occurs due to use of `y` in closure
8faf50e0
XL
10 | |
11 | second mutable borrow occurs here
532ac7d7 12LL |
8faf50e0 13LL | }
1b1a35ee 14 | - first borrow might be used here, when `c` is dropped and runs the destructor for type `RefCell<Vec<Box<dyn FnMut()>>>`
8faf50e0
XL
15
16error[E0499]: cannot borrow `y` as mutable more than once at a time
0731742a 17 --> $DIR/issue-18783.rs:16:29
8faf50e0
XL
18 |
19LL | Push::push(&c, Box::new(|| y = 0));
48663c56 20 | -- - first borrow occurs due to use of `y` in closure
8faf50e0
XL
21 | |
22 | first mutable borrow occurs here
23LL | Push::push(&c, Box::new(|| y = 0));
48663c56 24 | ^^ - second borrow occurs due to use of `y` in closure
8faf50e0
XL
25 | |
26 | second mutable borrow occurs here
532ac7d7 27LL |
8faf50e0 28LL | }
1b1a35ee 29 | - first borrow might be used here, when `c` is dropped and runs the destructor for type `RefCell<Vec<Box<dyn FnMut()>>>`
8faf50e0
XL
30
31error: aborting due to 2 previous errors
32
33For more information about this error, try `rustc --explain E0499`.