Skip to content

Handle ZeroSized constants in const_value_ty#96

Merged
coord-e merged 2 commits into
mainfrom
claude/gallant-mccarthy-3LOhV
May 25, 2026
Merged

Handle ZeroSized constants in const_value_ty#96
coord-e merged 2 commits into
mainfrom
claude/gallant-mccarthy-3LOhV

Conversation

@coord-e
Copy link
Copy Markdown
Owner

@coord-e coord-e commented May 25, 2026

apparently, #72 is fixed by #90

claude added 2 commits May 25, 2026 15:43
ZST struct instances (e.g. `struct Counter;`) are represented in
optimized MIR as `ConstValue::ZeroSized`. The `const_value_ty`
function had no case for this variant, causing an ICE whenever such
a constant appeared as a function argument or operand.

Add a catch-all `ConstValue::ZeroSized` arm that returns a unit
PlaceType (empty tuple), matching the existing treatment of empty-
tuple and zero-upvar-closure constants. Also add a UI regression
test for the two reproducers from issue #72.

Fixes #72.

https://claude.ai/code/session_01M4BtRPcV7cZxTsasLbGjxs
@coord-e coord-e merged commit e25bfb0 into main May 25, 2026
6 checks passed
@coord-e coord-e deleted the claude/gallant-mccarthy-3LOhV branch May 25, 2026 15:54
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.

2 participants