Skip to content

Commit

Permalink
Rollup merge of #124504 - gurry:123710-union-ICE, r=oli-obk
Browse files Browse the repository at this point in the history
Mark unions non-const-propagatable in `KnownPanicsLint` without calling layout

Fixes #123710

The ICE occurs during the layout calculation of the union `InvalidTag` in #123710 because the following assert fails:https://github.com/rust-lang/rust/blob/5fe8b697e729b6eb64841a3905e57da1b47f4ca3/compiler/rustc_abi/src/layout.rs#L289-L292

The layout calculation is invoked by `KnownPanicsLint` when it is trying to figure out which locals it can const prop. Since `KnownPanicsLint` is never actually going to const props unions thanks to PR rust-lang/rust#121628 there's no point calling layout to check if it can. So in this fix I skip the call to layout and just mark the local non-const propagatable if it is a union.
  • Loading branch information
jieyouxu authored Apr 29, 2024
2 parents 1ab8ac5 + f36a5b9 commit 84e6a8d
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 84e6a8d

Please sign in to comment.