diff --git a/tests/ui/generics/issue-79605.rs b/tests/ui/generics/issue-79605.rs new file mode 100644 index 0000000000000..6f4c31e57a374 --- /dev/null +++ b/tests/ui/generics/issue-79605.rs @@ -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() {} diff --git a/tests/ui/generics/issue-79605.stderr b/tests/ui/generics/issue-79605.stderr new file mode 100644 index 0000000000000..c5584962dc9e2 --- /dev/null +++ b/tests/ui/generics/issue-79605.stderr @@ -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 X<'_, T> {} + | +++ ~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0121`.