14 lines
142 B
Rust
14 lines
142 B
Rust
// error-pattern:borrowed
|
|
|
|
fn f(x: &int, y: @mut int) {
|
|
unsafe {
|
|
*y = 2;
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let x = @mut 3;
|
|
f(x, x);
|
|
}
|
|
|