interpreter: improve comments and error message in mir_assign_valid_types#155512
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 |
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 |
5239e33 to
ec0f805
Compare
This comment has been minimized.
This comment has been minimized.
ec0f805 to
20d66f0
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
20d66f0 to
ab617ae
Compare
|
Given that |
|
as stated in #155477 (comment), fixing |
|
I think it might still make sense to first land this as a trivial comments-only PR. And the fact that codegen wouldn't see the case that caused the problem also made me less enthusiastic about running this check in codegen. |
|
Because I was very much not on top of my notifications and declared bankruptcy 1st of may to start over |
| // Make sure the layout is equal, too -- just to be safe. Miri really needs layout equality. | ||
| // For performance reason we skip this check when the types are equal. Equal types *can* | ||
| // have different layouts when enum downcast is involved (as enum variants carry the type of | ||
| // the enum), but those should never occur in assignments. |
There was a problem hiding this comment.
This one was a bit confusing as the text didn't change, only line breaks in comments
There was a problem hiding this comment.
IIRC the old text went beyond the 100 column mark so I reflowed it. Sorry for the confusion. I wish we had better diff views for such comment changes.
…dity, r=oli-obk interpreter: improve comments and error message in mir_assign_valid_types I looked at this while debugging rust-lang#155477, but this makes no progress on that issue.
Rollup of 12 pull requests Successful merges: - #157085 (powerpc: warn against incorrect values for ABI-relevant target features) - #157170 (Use `impl` restrictions in `std`, `core`) - #157217 ([tiny] remove unecessary `.into()` calls) - #157262 (rustdoc: IXCRE: Preserve sizedness bounds on type params belonging to the parent item) - #157379 (Some more simple per-owner resolver changes) - #157381 (librustdoc: fix CSS border issue to support Firefox high contrast mode) - #155512 (interpreter: improve comments and error message in mir_assign_valid_types) - #157254 (Correct description of panic.rs) - #157290 (interpret: fix mir::UnOp layout computation) - #157332 (Rewrite target checking for `#[sanitize]`) - #157351 (Avoid leaking the query-job collection warning into the panic query stack) - #157389 (Add @clarfonthey to libs review rotation)
Rollup of 12 pull requests Successful merges: - rust-lang/rust#157085 (powerpc: warn against incorrect values for ABI-relevant target features) - rust-lang/rust#157170 (Use `impl` restrictions in `std`, `core`) - rust-lang/rust#157217 ([tiny] remove unecessary `.into()` calls) - rust-lang/rust#157262 (rustdoc: IXCRE: Preserve sizedness bounds on type params belonging to the parent item) - rust-lang/rust#157379 (Some more simple per-owner resolver changes) - rust-lang/rust#157381 (librustdoc: fix CSS border issue to support Firefox high contrast mode) - rust-lang/rust#155512 (interpreter: improve comments and error message in mir_assign_valid_types) - rust-lang/rust#157254 (Correct description of panic.rs) - rust-lang/rust#157290 (interpret: fix mir::UnOp layout computation) - rust-lang/rust#157332 (Rewrite target checking for `#[sanitize]`) - rust-lang/rust#157351 (Avoid leaking the query-job collection warning into the panic query stack) - rust-lang/rust#157389 (Add @clarfonthey to libs review rotation)
I looked at this while debugging #155477, but this makes no progress on that issue.