| commit | 2b551e7883a323bbdcde2e9a113c60185f10a326 | [log] [tgz] |
|---|---|---|
| author | bors <bors@rust-lang.org> | Fri Apr 11 23:21:31 2025 +0000 |
| committer | bors <bors@rust-lang.org> | Fri Apr 11 23:21:31 2025 +0000 |
| tree | ef774195e2de028a435a102296fdce93dbedd36f | |
| parent | c31a85d60adc521bd5a5b30a24bc4b9c50bf4a17 [diff] | |
| parent | d5f375deb2bfd43cd7d8ffac440ffb76aa35bf0d [diff] |
Auto merge of #139430 - scottmcm:polymorphic-array-into-iter, r=cuviper Polymorphize `array::IntoIter`'s iterator impl Today we emit all the iterator methods for every different array width. That's wasteful since the actual array length never even comes into it -- the indices used are from the separate `alive: IndexRange` field, not even the `N` const param. This PR switches things so that an `array::IntoIter<T, N>` stores a `PolymorphicIter<[MaybeUninit<T>; N]>`, which we *unsize* to `PolymorphicIter<[MaybeUninit<T>]>` and call methods on that non-`Sized` type for all the iterator methods. That also necessarily makes the layout consistent between the different lengths of arrays, because of the unsizing. Compare that to today <https://rust.godbolt.org/z/Prb4xMPrb>, where different widths can't even be deduped because the offset to the indices is different for different array widths.
rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.
https://rust-analyzer.github.io/book/installation.html
If you want to contribute to rust-analyzer check out the CONTRIBUTING.md or if you are just curious about how things work under the hood, see the Contributing section of the manual.
If you want to use rust-analyzer's language server with your editor of choice, check the manual. It also contains some tips & tricks to help you be more productive when using rust-analyzer.
See the security and privacy sections of the manual.
For usage and troubleshooting requests, please use “IDEs and Editors” category of the Rust forum:
https://users.rust-lang.org/c/ide/14
For questions about development and implementation, join rust-analyzer working group on Zulip:
https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer
rust-analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.