about summary refs log tree commit diff
path: root/src/test/compile-fail/extend-non-object.rs
blob: 0857ac990c0a393c94f3e6818d3478928bc24a0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//error-pattern:x does not have object type
use std;

fn main() {
    let x = 3;

    let anon_obj =
        obj () {
            fn foo() -> int { ret 3; }
            with
            x
        };
}