rust/src/test/compile-fail/static-method-privacy.rs
Patrick Walton 8693943676 librustc: Ensure that type parameters are in the right positions in paths.
This removes the stacking of type parameters that occurs when invoking
trait methods, and fixes all places in the standard library that were
relying on it. It is somewhat awkward in places; I think we'll probably
want something like the `Foo::<for T>::new()` syntax.
2013-08-27 18:47:57 -07:00

11 lines
152 B
Rust

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