librustc: Enforce privacy for static methods.
This starts moving a bunch of privacy checks into the privacy checking phase and out of resolve.
This commit is contained in:
parent
a14ec73cd2
commit
2e7ec80bcc
18 changed files with 306 additions and 106 deletions
11
src/test/compile-fail/static-method-privacy.rs
Normal file
11
src/test/compile-fail/static-method-privacy.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
mod a {
|
||||
pub struct S;
|
||||
impl S {
|
||||
static fn new() -> S { S }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = a::S::new(); //~ ERROR function `new` is private
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue