summaryrefslogtreecommitdiffstats
path: root/src/test/ui/derives/issue-43023.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/derives/issue-43023.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/derives/issue-43023.rs b/src/test/ui/derives/issue-43023.rs
new file mode 100644
index 000000000..c0208e680
--- /dev/null
+++ b/src/test/ui/derives/issue-43023.rs
@@ -0,0 +1,20 @@
+struct S;
+
+impl S {
+ #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
+ fn f() {
+ file!();
+ }
+}
+
+trait Tr1 {
+ #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
+ fn f();
+}
+
+trait Tr2 {
+ #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
+ type F;
+}
+
+fn main() {}