rust/tests/ui/issues/issue-18783.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
1.4 KiB
Plaintext
Raw Normal View History

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));
| -- - 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));
| ^^ - 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 | }
| - 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));
| -- - 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));
| ^^ - 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 | }
| - 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`.