librustc: Make methods private if the impl is private

This commit is contained in:
Patrick Walton 2013-02-27 11:20:50 -08:00
parent 107bf96ff0
commit 09a2b4e599
3 changed files with 63 additions and 13 deletions

View file

@ -0,0 +1,15 @@
// Tests that inherited visibility applies to methods.
mod a {
pub struct Foo;
impl Foo {
fn f(self) {}
}
}
fn main() {
let x = a::Foo;
x.f(); //~ ERROR method `f` is private
}