rust/tests/ui/impl-trait/extra-impl-in-trait-impl.rs
2024-07-04 22:05:00 +08:00

22 lines
409 B
Rust

//@ run-rustfix
#[allow(dead_code)]
struct S<T>(T);
#[allow(dead_code)]
struct S2;
impl<T: Default> impl Default for S<T> {
//~^ ERROR: unexpected `impl` keyword
//~| HELP: remove the extra `impl`
fn default() -> Self { todo!() }
}
impl impl Default for S2 {
//~^ ERROR: unexpected `impl` keyword
//~| HELP: remove the extra `impl`
fn default() -> Self { todo!() }
}
fn main() {}