Closed
Description
use std::task::spawn_unlinked;
use std::unstable::finally::Finally;
fn main() {
let (port, chan) = stream();
do spawn_unlinked {
let buf = @mut ~[0];
do (|| {
fn take(_b: &mut ~[uint]) {
fail!();
}
take(&mut *buf);
}).finally {
// This fails because buf is already borrowed
let x = &*buf;
assert!(*x == ~[0]);
chan.send(());
}
}
// This will fail if the finally block doesn't complete
port.recv();
}