2012-08-15 18:46:55 -07:00
|
|
|
struct r {
|
2012-05-15 20:33:59 -07:00
|
|
|
let i: @mut int;
|
|
|
|
new(i: @mut int) {
|
|
|
|
self.i = i;
|
|
|
|
}
|
|
|
|
drop { *(self.i) += 1; }
|
|
|
|
}
|
2011-09-27 22:40:15 -07:00
|
|
|
|
|
|
|
fn main() {
|
2012-03-26 18:35:18 -07:00
|
|
|
let i = @mut 0;
|
2011-11-18 16:15:46 +01:00
|
|
|
// Even though these look like copies, they are guaranteed not to be
|
|
|
|
{
|
|
|
|
let a = r(i);
|
|
|
|
let b = (a, 10);
|
|
|
|
let (c, _d) = b;
|
2011-12-22 17:53:53 -08:00
|
|
|
log(debug, c);
|
2011-11-18 16:15:46 +01:00
|
|
|
}
|
|
|
|
assert *i == 1;
|
|
|
|
}
|