Rollup merge of #110350 - SparkyPotato:test-79605, r=cjgillot

Add a UI test for #79605

#79605 was fixed somewhere between December 2020 and now, but it did not have a UI test.

This PR adds a UI test for the error.
This commit is contained in:
Yuki Okushi 2023-04-16 06:55:22 +09:00 committed by GitHub
commit 724da5cf11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,6 @@
struct X<'a, T>(&'a T);
impl X<'_, _> {}
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for implementations
fn main() {}

View File

@ -0,0 +1,14 @@
error[E0121]: the placeholder `_` is not allowed within types on item signatures for implementations
--> $DIR/issue-79605.rs:3:12
|
LL | impl X<'_, _> {}
| ^ not allowed in type signatures
|
help: use type parameters instead
|
LL | impl<T> X<'_, T> {}
| +++ ~
error: aborting due to previous error
For more information about this error, try `rustc --explain E0121`.