Skip to content

Fix a crash when transmuting non-immediate to immediate types - #7991

Closed
dotdash wants to merge 1 commit into
rust-lang:masterfrom
dotdash:transmute_ice
Closed

Fix a crash when transmuting non-immediate to immediate types#7991
dotdash wants to merge 1 commit into
rust-lang:masterfrom
dotdash:transmute_ice

Conversation

@dotdash

Copy link
Copy Markdown
Contributor

The code to build the transmute intrinsic currently makes the invalid
assumption that if the in-type is non-immediate, the out-type is
non-immediate as well. But this is wrong, for example when transmuting
[int, ..1] to int. So we need to handle this fourth case as well.

Fixes#7988

@huonw

Copy link
Copy Markdown
Contributor

(Removed my r+ pending adding the test from #7988.)

The code to build the transmute intrinsic currently makes the invalid
assumption that if the in-type is non-immediate, the out-type is
non-immediate as well. But this is wrong, for example when transmuting
[int, ..1] to int. So we need to handle this fourth case as well.
Fixesrust-lang#7988
@thestinger

Copy link
Copy Markdown
Contributor

Landing as part of #7982.

flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 17, 2021
Fix bad suggestion on `option_if_let_else` when there is complex subpat
closesrust-lang#7991
Prefer not warning any complex subpat in `option_if_let_else` rather than suggesting obscure suggestions.
changelog: [`option_if_let_else`] does not warn when complex subpat is present
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
7991: Simplify hir_def TestDB r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Sign up for freeto 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 when transmuting [T,..1] to T

3 participants

@dotdash@huonw@thestinger