rust/src/test/compile-fail/static-method-privacy.rs

12 lines
162 B
Rust
Raw Normal View History

mod a {
pub struct S;
impl S {
static fn new() -> S { S }
}
}
fn main() {
let _ = a::S::new(); //~ ERROR function `new` is private
}