check MIR assignment type validity check during codegen#155512
check MIR assignment type validity check during codegen#155512RalfJung wants to merge 2 commits intorust-lang:mainfrom
Conversation
|
r? @davidtwco rustbot has assigned @davidtwco. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
There was a problem hiding this comment.
I didn't know what would be a good place for this check as it needs both rustc_middle and rustc_trait_selection (so apparently we cannot put it in rustc_middle). rustc_ty_utils already has those dependencies and otherwise seems fairly lightweight so adding it as dependency in rustc_const_eval and rustc_codegen_ssa is hopefully fine?
4f96108 to
3e7a6e4
Compare
|
Strangely, codegen does not seem to see the same types as the interpreter / Miri. I can't reproduce the ICE there. |
|
Ah, transmute is implemented differently in codegen so we're not asking the It could still be worth checking |
3e7a6e4 to
5239e33
Compare
5239e33 to
ec0f805
Compare
|
☔ The latest upstream changes (presumably #155083) made this pull request unmergeable. Please resolve the merge conflicts. |
I looked at this while debugging #155477, but this makes no progress on that issue.
The first commit improves the check (subtyping should no longer be occurring here) makes the error message a bit more clear. The 2nd commit moves things around so that we can run the same check during codegen as well.