summaryrefslogtreecommitdiffstats
path: root/tests/ui/generics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generics')
-rw-r--r--tests/ui/generics/issue-79605.rs6
-rw-r--r--tests/ui/generics/issue-79605.stderr14
-rw-r--r--tests/ui/generics/single-colon-path-not-const-generics.rs4
-rw-r--r--tests/ui/generics/single-colon-path-not-const-generics.stderr11
4 files changed, 28 insertions, 7 deletions
diff --git a/tests/ui/generics/issue-79605.rs b/tests/ui/generics/issue-79605.rs
new file mode 100644
index 000000000..6f4c31e57
--- /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 000000000..c5584962d
--- /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<T> X<'_, T> {}
+ | +++ ~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/tests/ui/generics/single-colon-path-not-const-generics.rs b/tests/ui/generics/single-colon-path-not-const-generics.rs
index 55a7ae0bb..dff00b0b7 100644
--- a/tests/ui/generics/single-colon-path-not-const-generics.rs
+++ b/tests/ui/generics/single-colon-path-not-const-generics.rs
@@ -6,8 +6,8 @@ pub mod foo {
pub struct Foo {
a: Vec<foo::bar:A>,
- //~^ ERROR expected
- //~| HELP path separator
+ //~^ ERROR path separator must be a double colon
+ //~| HELP use a double colon instead
}
fn main() {}
diff --git a/tests/ui/generics/single-colon-path-not-const-generics.stderr b/tests/ui/generics/single-colon-path-not-const-generics.stderr
index 3eafa9fa5..96f07e190 100644
--- a/tests/ui/generics/single-colon-path-not-const-generics.stderr
+++ b/tests/ui/generics/single-colon-path-not-const-generics.stderr
@@ -1,11 +1,12 @@
-error: expected one of `,` or `>`, found `:`
+error: path separator must be a double colon
--> $DIR/single-colon-path-not-const-generics.rs:8:18
|
+LL | pub struct Foo {
+ | --- while parsing this struct
LL | a: Vec<foo::bar:A>,
- | ^
- | |
- | expected one of `,` or `>`
- | help: write a path separator here: `::`
+ | ^ help: use a double colon instead: `::`
+ |
+ = note: if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
error: aborting due to previous error