diff options
Diffstat (limited to 'tests/ui/derives/issue-43023.rs')
-rw-r--r-- | tests/ui/derives/issue-43023.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/derives/issue-43023.rs b/tests/ui/derives/issue-43023.rs new file mode 100644 index 000000000..c0208e680 --- /dev/null +++ b/tests/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() {} |