2012-08-17 17:30:29 -07:00
|
|
|
struct defer {
|
2012-09-07 14:50:47 -07:00
|
|
|
x: &[&str],
|
2012-10-12 12:32:36 -07:00
|
|
|
drop { error!("%?", self.x); }
|
2012-08-17 17:30:29 -07:00
|
|
|
}
|
|
|
|
|
2012-09-05 15:58:43 -07:00
|
|
|
fn defer(x: &r/[&r/str]) -> defer/&r {
|
|
|
|
defer {
|
|
|
|
x: x
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-17 17:30:29 -07:00
|
|
|
fn main() {
|
|
|
|
let _x = defer(~["Goodbye", "world!"]); //~ ERROR illegal borrow
|
|
|
|
}
|