Handle index projections in call destinations in DSE#155680
Handle index projections in call destinations in DSE#155680rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
Since call destinations are evaluated after call arguments, we can't turn copy arguments into moves if the same local is later used as an index projection in the call destination.
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
@bors r+ rollup |
…illot Handle index projections in call destinations in DSE Since call destinations are evaluated after call arguments, we can't turn copy arguments into moves if the same local is later used as an index projection in the call destination. DSE call arg optimization: rust-lang#113758 r? @cjgillot cc @RalfJung
Rollup of 7 pull requests Successful merges: - #155643 (Improve suggestion for $-prefixed fragment specifiers) - #154197 (Avoid redundant clone suggestions in borrowck diagnostics) - #154372 (Exposing Float Masks) - #155680 (Handle index projections in call destinations in DSE) - #155732 (bootstrap: Don't clone submodules unconditionally in dry-run) - #155737 (Account for `GetSyntheticValue` failures) - #155738 (Pass fields to `is_tuple_fields` instead of `SBValue` object)
Are they? Hm I guess in Miri they really are. That seems like a mistake to me. For assignments we evaluate the destination first, and we generally use left-to-right evaluation order. Do you know what codegen does / whether it even matters there? |
This is a Miri-only problem, right? Is there an example/issue somewhere that this is fixing, or how did you even notice this problem? |
|
I don't think we ever generate MIR that triggers this, I only noticed this as a possibility while reviewing existing MIR optimization in preparation for implementing the MIR move optimization. |
|
I don't see any reason why |
Since call destinations are evaluated after call arguments, we can't turn copy arguments into moves if the same local is later used as an index projection in the call destination.
DSE call arg optimization: #113758
r? @cjgillot
cc @RalfJung