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

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

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