Have arrays' drop_glue just unsize and call the slice version#155184
Have arrays' drop_glue just unsize and call the slice version#155184scottmcm wants to merge 10 commits intorust-lang:mainfrom
drop_glue just unsize and call the slice version#155184Conversation
|
|
|
|
||
| // RAW: ; core::ptr::drop_glue::<[array_drop_glue::NeedsDrop; [[N:7|13|42]]]> | ||
| // RAW-NEXT: inlinehint | ||
| // RAW: call core::ptr::drop_glue::<[array_drop_glue::NeedsDrop]> |
There was a problem hiding this comment.
Compare nightly https://rust.godbolt.org/z/5Wv1q86ja with a loop in each of the three.
This comment has been minimized.
This comment has been minimized.
|
💭 does it make sense to keep the array case separate for |
|
My understanding is that LLVM will very effectively inline those -- just like how we don't special case the array iterator for N ≤ 1 and still use the polymorphic version. Does make me ponder if we should have a separate general "hey, there's no |
d1bdee8 to
2ae092a
Compare
|
☔ The latest upstream changes (presumably #155207) made this pull request unmergeable. Please resolve the merge conflicts. |
It's silly to emit two loops (because of the drop ladder -- just one in panic=abort) for every array length that's dropped when we can just polymorphize to the slice version.
Built atop #154327 to avoid conflicts later, so draft for now.
r? @WaffleLapkin