diff options
| author | Yotam Ofek <yotam.ofek@gmail.com> | 2025-04-11 14:26:26 +0000 |
|---|---|---|
| committer | Yotam Ofek <yotam.ofek@gmail.com> | 2025-04-12 11:53:07 +0000 |
| commit | c36e8fcc3c128e31eaa643904c9b8b33d9a5c1a6 (patch) | |
| tree | 31cd8b18b75a984f696f42b5950772cb0050cb23 /compiler/rustc_index_macros | |
| parent | 69b3959afec9b5468d5de15133b199553f6e55d2 (diff) | |
| download | rust-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.rs | 7 |
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 { |
