about summary refs log tree commit diff
path: root/compiler/rustc_index_macros
diff options
context:
space:
mode:
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 {