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

6 lines
171 B
Rust
Raw Normal View History

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