Commit f06a3c4
gccrs: add error check if derive has wrong item
Derive may only be applied to structs, enums and unions.
gcc/rust/ChangeLog:
* expand/rust-derive.cc (DeriveVisitor::derive):
Add check and error.
gcc/testsuite/ChangeLog:
* rust/compile/issue-3971.rs: New test.
Signed-off-by: Lucas Ly Ba <lucas.ly-ba@outlook.com>1 parent 6e5929a commit f06a3c4
File tree
2 files changed
+22
-0
lines changed- gcc
- rust/expand
- testsuite/rust/compile
2 files changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments