summary refs log tree commit diff
path: root/compiler/rustc_index_macros
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-04-11 14:26:26 +0000
committerYotam Ofek <yotam.ofek@gmail.com>2025-04-12 11:53:07 +0000
commitc36e8fcc3c128e31eaa643904c9b8b33d9a5c1a6 (patch)
tree31cd8b18b75a984f696f42b5950772cb0050cb23 /compiler/rustc_index_macros
parent69b3959afec9b5468d5de15133b199553f6e55d2 (diff)
downloadrust-c36e8fcc3c128e31eaa643904c9b8b33d9a5c1a6.tar.gz
rust-c36e8fcc3c128e31eaa643904c9b8b33d9a5c1a6.zip
In `rustc_mir_tranform`, iterate over index newtypes instead of ints
Diffstat (limited to 'compiler/rustc_index_macros')
-rw-r--r--compiler/rustc_index_macros/src/newtype.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_index_macros/src/newtype.rs b/compiler/rustc_index_macros/src/newtype.rs
index f0b58eabbff..eedbe630cf2 100644
--- a/compiler/rustc_index_macros/src/newtype.rs
+++ b/compiler/rustc_index_macros/src/newtype.rs
@@ -257,6 +257,13 @@ impl Parse for Newtype {
                 }
             }
 
+            impl std::ops::AddAssign<usize> for #name {
+                #[inline]
+                fn add_assign(&mut self, other: usize) {
+                    *self = *self + other;
+                }
+            }
+
             impl rustc_index::Idx for #name {
                 #[inline]
                 fn new(value: usize) -> Self {