improve error for impl<..> impl Trait for Type
This commit is contained in:
parent
69fef92ab2
commit
7fe83345ef
6 changed files with 97 additions and 4 deletions
19
tests/ui/impl-trait/extra-impl-in-trait-impl.fixed
Normal file
19
tests/ui/impl-trait/extra-impl-in-trait-impl.fixed
Normal 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() {}
|
Loading…
Add table
Add a link
Reference in a new issue