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