Commit 6b891ee
expand: Fix ICE on unimplemented RustcEncodable/Decodable derives
When encountering `#[derive(RustcEncodable)]` or `RustcDecodable`, the
`DeriveVisitor` previously fell through to `rust_unreachable ()`,
causing an Internal Compiler Error.
This patch adds cases for these built-in macros to explicitly emit a
"sorry, unimplemented" message instead of crashing.
Fixes #3951
gcc/rust/ChangeLog:
* expand/rust-derive.cc (DeriveVisitor::derive): Handle
`BuiltinMacro::RustcEncodable` and `BuiltinMacro::RustcDecodable`.
gcc/testsuite/ChangeLog:
* rust/compile/issue-3951.rs: New test.
Signed-off-by: jayant chauhan <0001jayant@gmail.com>1 parent 0cc6e9c commit 6b891ee
File tree
2 files changed
+20
-0
lines changed- gcc
- rust/expand
- testsuite/rust/compile
2 files changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments