Reimplement NormalizeArrayLen based on SsaLocals#107172
Reimplement NormalizeArrayLen based on SsaLocals#107172bors merged 2 commits intorust-lang:masterfrom
Conversation
|
r? @nagisa (rustbot has picked a reviewer for you, use r? to override) |
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
nagisa
left a comment
There was a problem hiding this comment.
The last commit seems reasonable to me!
r=me (with the issue link removed and the prerequisite PR landed)
There was a problem hiding this comment.
Shouldn’t the comment above be removed at this point?
There was a problem hiding this comment.
(This is just me trying to understand code rather than suggesting any particular change to be made – you can largely ignore this.) Is this check necessary at all? I guess it is a nice defense-in-depth measure, but what other things an unsizing cast could be to? A dynamic object?
There was a problem hiding this comment.
Yes, Unsize has to be interpreted based on both input and output types. We only want &[T; _] -> &[T]. The other possible cases are &T -> &dyn Trait, &dyn Trait1 -> &dyn Trait2, Struct<[T; _]> -> Struct<[T]>.
|
☔ The latest upstream changes (presumably #107309) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@bors r=nagisa |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#107125 (Add and use expect methods to hir.) - rust-lang#107172 (Reimplement NormalizeArrayLen based on SsaLocals) - rust-lang#107177 (Keep all theme-updating logic together) - rust-lang#107424 (Make Vec::clone_from and slice::clone_into share the same code) - rust-lang#107455 (use a more descriptive name) - rust-lang#107465 (`has_allow_dead_code_or_lang_attr` micro refactor) - rust-lang#107469 (Change turbofish context link to an archive link) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Based on #106908
Fixes #105929
Only the last commit "Reimplement NormalizeArrayLen" is relevant.