-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Compiler crash pattern matching unsized tuple in enum variant #37685
Copy link
Copy link
Closed
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I was trying to get an enum which owns some
StringorVec<u8>be able to deref into an unsized enum whose variants havestror[u8]but this appears to be unsupported at the moment.But I am persistent so I try to make the variants hold refs to their original owners but one of them is a tuple.
I found plenty of issues where tuples are also not allowed to have their tail unsized (which seems odd as tuple structs are perfectly fine having their last member unsized) but I tried it anyway in the context of an enum variant tuple.
I tried this code: playground
I expected to see this happen: A sane error about tuples not being allowed to have an unsized tail.
Instead, this happened: mysterious exit (
error: Could not compile ...without any further explanation) with error code 3221225477. On the playground this results inSegmentation fault (core dumped).As I wrote this I found out that the above example only breaks in Debug builds, Release builds print
Program ended.on any Rust version on the playground.Meta