rust/src/test/compile-fail/unsafe-mutable-alias.rs
Marijn Haverbeke 982a1a4783 Rename alias to reference in docs and error messages
Update docs to reflect new approach to aliases
2011-09-12 14:24:46 +02:00

9 lines
223 B
Rust

// error-pattern:mutable reference to a variable that roots another reference
fn f(a: {mutable x: int}, &b: {mutable x: int}) -> int {
b.x += 1;
ret a.x + b.x;
}
fn main() { let i = {mutable x: 4}; log f(i, i); }