about summary refs log tree commit diff
path: root/src/test/compile-fail/private-impl-method.rs
blob: 2d6047b36470ecb63cdb487e68c846f40da9b2ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mod a {
    struct Foo {
        x: int
    }

    impl Foo {
        priv fn foo() {}
    }
}

fn main() {
    let s = a::Foo { x: 1 };
    s.foo();    //~ ERROR method `foo` is private
}