1 error[E0499]: cannot borrow `y` as mutable more than once at a time
2 --> $DIR/issue-18783.rs:7:21
4 LL | c.push(Box::new(|| y = 0));
5 | -- - first borrow occurs due to use of `y` in closure
7 | first mutable borrow occurs here
8 LL | c.push(Box::new(|| y = 0));
9 | ^^ - second borrow occurs due to use of `y` in closure
11 | second mutable borrow occurs here
14 | - first borrow might be used here, when `c` is dropped and runs the destructor for type `RefCell<Vec<Box<dyn FnMut()>>>`
16 error[E0499]: cannot borrow `y` as mutable more than once at a time
17 --> $DIR/issue-18783.rs:16:29
19 LL | Push::push(&c, Box::new(|| y = 0));
20 | -- - first borrow occurs due to use of `y` in closure
22 | first mutable borrow occurs here
23 LL | Push::push(&c, Box::new(|| y = 0));
24 | ^^ - second borrow occurs due to use of `y` in closure
26 | second mutable borrow occurs here
29 | - first borrow might be used here, when `c` is dropped and runs the destructor for type `RefCell<Vec<Box<dyn FnMut()>>>`
31 error: aborting due to 2 previous errors
33 For more information about this error, try `rustc --explain E0499`.