1
Fork 0

In rustc_mir_tranform, iterate over index newtypes instead of ints

This commit is contained in:
Yotam Ofek 2025-04-11 14:26:26 +00:00
parent 69b3959afe
commit c36e8fcc3c
6 changed files with 46 additions and 53 deletions

View file

@ -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 {