about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-09 17:36:48 +0000
committerbors <bors@rust-lang.org>2023-05-09 17:36:48 +0000
commitb7cdd93f3e1533e96d4cfa1ac8573e6210a2bedf (patch)
treee893f9a927eb64e163db90e91939dda0953b92a4 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff
parentc26a43d6bd660eba94500645a47f931e153015d8 (diff)
parentadd94d3b9ca53921796ad1336aa67701b6cf888a (diff)
downloadrust-b7cdd93f3e1533e96d4cfa1ac8573e6210a2bedf.tar.gz
rust-b7cdd93f3e1533e96d4cfa1ac8573e6210a2bedf.zip
Auto merge of #14747 - oxalica:feat/arena-idx-range, r=HKalbasi
More APIs for `la_arena::IdxRange`

```rust
impl<T> ExactSizeIterator for IdxRange<T>;

impl<T> Arena<T> {
    pub fn alloc_many<II: IntoIterator<Item = T>>(&mut self, iter: II) -> IdxRange<T>;
}
```

1. There are no currently ways to get `IdxRange` without manually offseting `Idx`. Providing a method for multiple-allocation simplifies this process and makes it less error-prone.
2. `IdxRange: ExactSizeIterator` makes `iter.zip(range).rev()` possible. Since `Zip: DoubleEndedIterator` requires all its arguments to be `ExactSizeIterator`. It also ease the usage for, eg. `len()`.
3. Fixed a typo.

I noticed that `IdxRange::end` may be invalid. Is it good to return `Idx` instead of `RawIdx`?
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-abort.diff')
0 files changed, 0 insertions, 0 deletions