about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2022-05-27 10:47:05 -0700
committerEsteban Küber <esteban@kuber.com.ar>2022-05-27 10:47:05 -0700
commitd21bc6562a03917073bd1fd4f65f447cf5a92aba (patch)
treebb2d10a55fd568a5bf85943c620ef6fefa88fb60
parentb2c9872c6c2c60c905e16bce0801934b86d15f95 (diff)
downloadrust-d21bc6562a03917073bd1fd4f65f447cf5a92aba.tar.gz
rust-d21bc6562a03917073bd1fd4f65f447cf5a92aba.zip
Add test for #97343
-rw-r--r--src/test/ui/derives/issue-97343.rs8
-rw-r--r--src/test/ui/derives/issue-97343.stderr22
2 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/derives/issue-97343.rs b/src/test/ui/derives/issue-97343.rs
new file mode 100644
index 00000000000..6c5626f4796
--- /dev/null
+++ b/src/test/ui/derives/issue-97343.rs
@@ -0,0 +1,8 @@
+use std::fmt::Debug;
+
+#[derive(Debug)] //~ ERROR expected struct, variant or union type, found type parameter `Irrelevant`
+pub struct Irrelevant<Irrelevant> { //~ ERROR type arguments are not allowed for this type
+    irrelevant: Irrelevant,
+}
+
+fn main() {}
diff --git a/src/test/ui/derives/issue-97343.stderr b/src/test/ui/derives/issue-97343.stderr
new file mode 100644
index 00000000000..418178b01b9
--- /dev/null
+++ b/src/test/ui/derives/issue-97343.stderr
@@ -0,0 +1,22 @@
+error[E0574]: expected struct, variant or union type, found type parameter `Irrelevant`
+  --> $DIR/issue-97343.rs:3:10
+   |
+LL | #[derive(Debug)]
+   |          ^^^^^ not a struct, variant or union type
+   |
+   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0109]: type arguments are not allowed for this type
+  --> $DIR/issue-97343.rs:4:23
+   |
+LL | #[derive(Debug)]
+   |          ----- in this derive macro expansion
+LL | pub struct Irrelevant<Irrelevant> {
+   |                       ^^^^^^^^^^ type argument not allowed
+   |
+   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0109, E0574.
+For more information about an error, try `rustc --explain E0109`.