Skip to content

fail loudly on unsized by-ref invariants#1644

Merged
bjorn3 merged 2 commits intorust-lang:mainfrom
0xmuon:fix3
Apr 16, 2026
Merged

fail loudly on unsized by-ref invariants#1644
bjorn3 merged 2 commits intorust-lang:mainfrom
0xmuon:fix3

Conversation

@0xmuon
Copy link
Copy Markdown
Contributor

@0xmuon 0xmuon commented Apr 14, 2026

replace the remaining todo!() paths for unsized by-ref values in src/value_and_place.rs with explicit bug!() failures.
This makes invariant violations fail loudly instead of panicking via unfinished code paths,and without claiming support for unsized by-ref handling that is not actually implemented.

Comment thread src/value_and_place.rs Outdated
@0xmuon
Copy link
Copy Markdown
Contributor Author

0xmuon commented Apr 14, 2026

Is “copy sized prefix when writing from ByRef(_, Some(meta)) into a sized place” fallback acceptable or would you prefer we span_bug! there instead to enforce that such writes never happen?

Comment thread src/value_and_place.rs
Copy link
Copy Markdown
Member

@bjorn3 bjorn3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the PR title and description to match the contents of the PR. Other than that LGTM.

View changes since this review

@0xmuon 0xmuon changed the title handle unsized by-ref values fail loudly on unsized by-ref invariants Apr 16, 2026
@0xmuon
Copy link
Copy Markdown
Contributor Author

0xmuon commented Apr 16, 2026

Done!

@bjorn3 bjorn3 merged commit 5a7d658 into rust-lang:main Apr 16, 2026
25 checks passed
bjorn3 pushed a commit that referenced this pull request Apr 16, 2026
replace the remaining todo!() paths for unsized by-ref values in
src/value_and_place.rs with explicit bug!() failures. This makes
invariant violations fail loudly instead of panicking via unfinished
code paths,and without claiming support for unsized by-ref handling
that is not actually implemented.
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