Closed
Description
Example program:
use std::util;
fn main() {
let mut x = ();
util::ignore((&mut x, util::ignore(&mut x)));
}
The error is "can't borrow x as mutable more than once at a time", even though a trivial rewrite of the program would show that the first borrow doesn't live until the second function call is made.
In case this looks too contrived, the actual code I was writing when I ran into this was:
sched.enqueue_task(blk(~Task::new_root(&mut sched.stack_pool, ||{})));