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

12 lines
196 B
Rust
Raw Normal View History

fn main() {
let msg;
match some(~"Hello") { //~ ERROR illegal borrow
some(ref m) => {
msg = m;
},
none => { fail }
}
io::println(*msg);
}