fix #102182, recover from impl Trait in type param bound

This commit is contained in:
yukang 2022-09-27 14:25:29 +08:00
parent 672e3f4d77
commit 7b2f04a2b3
3 changed files with 51 additions and 2 deletions

View file

@ -0,0 +1,3 @@
fn foo<T: impl Trait>() {}
//~^ ERROR expected trait bound, found `impl Trait` type
fn main() {}

View file

@ -0,0 +1,14 @@
error: expected trait bound, found `impl Trait` type
--> $DIR/issue-102182-impl-trait-recover.rs:1:11
|
LL | fn foo<T: impl Trait>() {}
| ^^^^^^^^^^ not a trait
|
help: use the trait bounds directly
|
LL - fn foo<T: impl Trait>() {}
LL + fn foo<T: Trait>() {}
|
error: aborting due to previous error