summary refs log tree commit diff
path: root/src/test/compile-fail/unsafe-alias.rs
blob: 0b13c5b5305a15621e9cacd11e41a129a154a62e (plain)
1
2
3
4
5
6
7
8
9
10
// error-pattern:may alias with argument

fn foo(x: {mut x: int}, f: fn@()) { log(debug, x); }

fn whoknows(x: @mut {mut x: int}) { *x = {mut x: 10}; }

fn main() {
    let box = @mut {mut x: 1};
    foo(*box, bind whoknows(box));
}