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 21:11:54 +00:00
error[E0499]: cannot borrow `y` as mutable more than once at a time
2018-12-25 15:56:47 +00:00
--> $DIR/issue-18783.rs:7:21
2018-07-15 21:11:54 +00:00
|
LL | c.push(Box::new(|| y = 0));
| -- - first borrow occurs due to use of `y` in closure
2018-07-15 21:11:54 +00: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 21:11:54 +00:00
| |
| second mutable borrow occurs here
2019-03-09 12:03:44 +00:00
LL |
2018-07-15 21:11:54 +00: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 21:11:54 +00:00
error[E0499]: cannot borrow `y` as mutable more than once at a time
2018-12-25 15:56:47 +00:00
--> $DIR/issue-18783.rs:16:29
2018-07-15 21:11:54 +00:00
|
LL | Push::push(&c, Box::new(|| y = 0));
| -- - first borrow occurs due to use of `y` in closure
2018-07-15 21:11:54 +00: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 21:11:54 +00:00
| |
| second mutable borrow occurs here
2019-03-09 12:03:44 +00:00
LL |
2018-07-15 21:11:54 +00: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 21:11:54 +00:00
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0499`.