]> git.lizzy.rs Git - rust.git/blob - src/test/ui/privacy/private-impl-method.rs
Merge commit 'cd4810de42c57b64b74dae09c530a4c3a41f87b9' into libgccjit-codegen
[rust.git] / src / test / ui / privacy / private-impl-method.rs
1 mod a {
2     pub struct Foo {
3         pub x: isize
4     }
5
6     impl Foo {
7         fn foo(&self) {}
8     }
9 }
10
11 fn f() {
12     impl a::Foo {
13         fn bar(&self) {} // This should be visible outside `f`
14     }
15 }
16
17 fn main() {
18     let s = a::Foo { x: 1 };
19     s.bar();
20     s.foo();    //~ ERROR associated function `foo` is private
21 }