2018-07-15 16:11:54 -05:00
|
|
|
error[E0499]: cannot borrow `y` as mutable more than once at a time
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-18783.rs:7:21
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | c.push(Box::new(|| y = 0));
|
2019-04-22 02:40:08 -05:00
|
|
|
| -- - first borrow occurs due to use of `y` in closure
|
2018-07-15 16:11:54 -05:00
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
LL | c.push(Box::new(|| y = 0));
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^ - second borrow occurs due to use of `y` in closure
|
2018-07-15 16:11:54 -05:00
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL |
|
2018-07-15 16:11:54 -05:00
|
|
|
LL | }
|
2020-09-02 02:40:56 -05:00
|
|
|
| - first borrow might be used here, when `c` is dropped and runs the destructor for type `RefCell<Vec<Box<dyn FnMut()>>>`
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
error[E0499]: cannot borrow `y` as mutable more than once at a time
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-18783.rs:16:29
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | Push::push(&c, Box::new(|| y = 0));
|
2019-04-22 02:40:08 -05:00
|
|
|
| -- - first borrow occurs due to use of `y` in closure
|
2018-07-15 16:11:54 -05:00
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
LL | Push::push(&c, Box::new(|| y = 0));
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^ - second borrow occurs due to use of `y` in closure
|
2018-07-15 16:11:54 -05:00
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL |
|
2018-07-15 16:11:54 -05:00
|
|
|
LL | }
|
2020-09-02 02:40:56 -05:00
|
|
|
| - first borrow might be used here, when `c` is dropped and runs the destructor for type `RefCell<Vec<Box<dyn FnMut()>>>`
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0499`.
|