2012-09-05 01:28:22 +00:00
|
|
|
mod a {
|
2013-01-30 22:30:22 +00:00
|
|
|
pub struct Foo {
|
2015-01-08 10:54:35 +00:00
|
|
|
pub x: isize
|
2012-09-05 01:28:22 +00:00
|
|
|
}
|
|
|
|
|
2013-05-31 22:17:22 +00:00
|
|
|
impl Foo {
|
2013-08-08 03:20:06 +00:00
|
|
|
fn foo(&self) {}
|
2012-09-05 01:28:22 +00: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-05 01:28:22 +00:00
|
|
|
fn main() {
|
|
|
|
let s = a::Foo { x: 1 };
|
2016-02-23 00:22:52 +00:00
|
|
|
s.bar();
|
2023-02-21 21:11:08 +00:00
|
|
|
s.foo(); //~ ERROR method `foo` is private
|
2012-09-05 01:28:22 +00:00
|
|
|
}
|