1
Fork 0

improve error for impl<..> impl Trait for Type

This commit is contained in:
y21 2023-05-11 21:55:50 +02:00
parent 69fef92ab2
commit 7fe83345ef
6 changed files with 97 additions and 4 deletions

View file

@ -0,0 +1,19 @@
// run-rustfix
struct S<T>(T);
struct S2;
impl<T: Default> Default for S<T> {
//~^ ERROR: unexpected `impl` keyword
//~| HELP: remove the extra `impl`
fn default() -> Self { todo!() }
}
impl Default for S2 {
//~^ ERROR: unexpected `impl` keyword
//~| HELP: remove the extra `impl`
fn default() -> Self { todo!() }
}
fn main() {}