rust/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs

10 lines
188 B
Rust
Raw Normal View History

struct defer {
x: &[&str];
new(x: &[&str]) { self.x = x; }
drop { #error["%?", self.x]; }
}
fn main() {
let _x = defer(~["Goodbye", "world!"]); //~ ERROR illegal borrow
}