2012-09-04 18:28:22 -07:00
|
|
|
mod a {
|
2013-01-30 14:30:22 -08:00
|
|
|
pub struct Foo {
|
2015-01-08 21:54:35 +11:00
|
|
|
pub x: isize
|
2012-09-04 18:28:22 -07:00
|
|
|
}
|
|
|
|
|
2013-05-31 15:17:22 -07:00
|
|
|
impl Foo {
|
2013-08-07 23:20:06 -04:00
|
|
|
fn foo(&self) {}
|
2012-09-04 18:28:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-23 00:22:52 +00:00
|
|
|
fn f() {
|
|
|
|
impl a::Foo {
|
|
|
|
fn bar(&self) {} // This should be visible outside `f`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-04 18:28:22 -07:00
|
|
|
fn main() {
|
|
|
|
let s = a::Foo { x: 1 };
|
2016-02-23 00:22:52 +00:00
|
|
|
s.bar();
|
2023-02-21 14:11:08 -07:00
|
|
|
s.foo(); //~ ERROR method `foo` is private
|
2012-09-04 18:28:22 -07:00
|
|
|
}
|