diff options
| author | Jeremy Smart <jeremy3141592@gmail.com> | 2025-07-31 23:27:02 -0400 |
|---|---|---|
| committer | Jeremy Smart <jeremy3141592@gmail.com> | 2025-09-08 22:07:43 -0400 |
| commit | 8d0c07f1a1ccc46f58d2c6dbf0dbf32dc0b0d6b9 (patch) | |
| tree | 0d328de6ffe270424d23b8a29ac875b98e87d4fa /compiler/rustc_index | |
| parent | 51ff895062ba60a7cba53f57af928c3fb7b0f2f4 (diff) | |
| download | rust-8d0c07f1a1ccc46f58d2c6dbf0dbf32dc0b0d6b9.tar.gz rust-8d0c07f1a1ccc46f58d2c6dbf0dbf32dc0b0d6b9.zip | |
change end to last
Diffstat (limited to 'compiler/rustc_index')
| -rw-r--r-- | compiler/rustc_index/src/idx.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_index/src/idx.rs b/compiler/rustc_index/src/idx.rs index 33f406e2113..9cd7134659c 100644 --- a/compiler/rustc_index/src/idx.rs +++ b/compiler/rustc_index/src/idx.rs @@ -130,7 +130,22 @@ impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeFrom<I> { impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeInclusive<I> { type Output = core::range::RangeInclusive<usize>; #[inline] + #[cfg(bootstrap)] fn into_slice_idx(self) -> Self::Output { core::range::RangeInclusive { start: self.start.index(), end: self.end.index() } } + #[inline] + #[cfg(not(bootstrap))] + fn into_slice_idx(self) -> Self::Output { + core::range::RangeInclusive { start: self.start.index(), last: self.last.index() } + } +} + +#[cfg(all(feature = "nightly", not(bootstrap)))] +impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeToInclusive<I> { + type Output = core::range::RangeToInclusive<usize>; + #[inline] + fn into_slice_idx(self) -> Self::Output { + core::range::RangeToInclusive { last: self.last.index() } + } } |
