about summary refs log tree commit diff
path: root/compiler/rustc_index
diff options
context:
space:
mode:
authorJeremy Smart <jeremy3141592@gmail.com>2025-07-31 23:27:02 -0400
committerJeremy Smart <jeremy3141592@gmail.com>2025-09-08 22:07:43 -0400
commit8d0c07f1a1ccc46f58d2c6dbf0dbf32dc0b0d6b9 (patch)
tree0d328de6ffe270424d23b8a29ac875b98e87d4fa /compiler/rustc_index
parent51ff895062ba60a7cba53f57af928c3fb7b0f2f4 (diff)
downloadrust-8d0c07f1a1ccc46f58d2c6dbf0dbf32dc0b0d6b9.tar.gz
rust-8d0c07f1a1ccc46f58d2c6dbf0dbf32dc0b0d6b9.zip
change end to last
Diffstat (limited to 'compiler/rustc_index')
-rw-r--r--compiler/rustc_index/src/idx.rs15
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() }
+    }
 }