Skip to content

expand: Fix ICE on unimplemented RustcEncodable/Decodable derives#4437

Open
Pasta-coder wants to merge 1 commit intoRust-GCC:masterfrom
Pasta-coder:issue-3951
Open

expand: Fix ICE on unimplemented RustcEncodable/Decodable derives#4437
Pasta-coder wants to merge 1 commit intoRust-GCC:masterfrom
Pasta-coder:issue-3951

Conversation

@Pasta-coder
Copy link
Contributor

Fixes #3951

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 Rust-GCC#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE in derive, at rust/expand/rust-derive.cc:67

1 participant