about summary refs log tree commit diff
path: root/compiler/rustc_index/src
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-04-01 20:11:38 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-04-01 20:32:50 -0700
commitb5b6def021d37c5f1cb7e06c1cf6915bcbcd53b1 (patch)
tree417306b55b8f87daebb5962a774330552beb1337 /compiler/rustc_index/src
parent480068c2359ea65df4481788b5ce717a548ce171 (diff)
downloadrust-b5b6def021d37c5f1cb7e06c1cf6915bcbcd53b1.tar.gz
rust-b5b6def021d37c5f1cb7e06c1cf6915bcbcd53b1.zip
Use `FieldIdx` in various things related to aggregates
Shrank `AggregateKind` by 8 bytes on x64, since the active field of a union is tracked as an `Option<FieldIdx>` instead of `Option<usize>`.
Diffstat (limited to 'compiler/rustc_index/src')
-rw-r--r--compiler/rustc_index/src/vec.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_index/src/vec.rs b/compiler/rustc_index/src/vec.rs
index 596849bd456..6caae059f4a 100644
--- a/compiler/rustc_index/src/vec.rs
+++ b/compiler/rustc_index/src/vec.rs
@@ -93,6 +93,12 @@ impl<I: Idx, T: fmt::Debug> fmt::Debug for IndexVec<I, T> {
     }
 }
 
+impl<I: Idx, T: fmt::Debug> fmt::Debug for IndexSlice<I, T> {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&self.raw, fmt)
+    }
+}
+
 impl<I: Idx, T> IndexVec<I, T> {
     #[inline]
     pub fn new() -> Self {