rust/src/test/compile-fail/borrowck-ref-into-rvalue.rs

12 lines
196 B
Rust
Raw Normal View History

fn main() {
let msg;
2012-08-20 12:23:37 -07:00
match Some(~"Hello") { //~ ERROR illegal borrow
Some(ref m) => {
msg = m;
},
2012-08-20 12:23:37 -07:00
None => { fail }
}
io::println(*msg);
}