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

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

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

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