2011-06-10 09:38:13 -05:00
|
|
|
// error-pattern:mutable alias to a variable that roots another alias
|
|
|
|
|
2011-09-12 03:12:36 -05:00
|
|
|
fn f(a: &{mutable x: int}, b: &mutable {mutable x: int}) -> int {
|
|
|
|
b.x += 1; ret a.x + b.x;
|
|
|
|
}
|
2011-06-10 09:38:13 -05:00
|
|
|
|
2011-09-12 03:12:36 -05:00
|
|
|
fn main() { let i = {mutable x: 4}; log f(i, i); }
|