rust/src/test/compile-fail/unsafe-mutable-alias.rs

5 lines
170 B
Rust
Raw Normal View History

// error-pattern:mutable alias to a variable that roots another alias
2011-07-27 14:19:39 +02:00
fn f(a: &int, b: &mutable int) -> int { b += 1; ret a + b; }
2011-07-27 14:19:39 +02:00
fn main() { let i = 4; log f(i, i); }