Closed
Description
The following code will fail to compile at "Self::new()" with the message, "error: failed to resolve. Use of undeclared type or module Self
"
struct Foo;
impl Foo {
fn new() -> Self { Foo }
fn bar() { Self::new(); }
}
While either of the following will work:
fn bar() { <Self>::new(); }
fn bar() { let x: Self = Foo::new(); }
The first example should compile as-is.