rustc_index: Add a ZERO constant to index types

It is commonly used.
This commit is contained in:
Vadim Petrochenkov
2024-04-03 17:49:59 +03:00
parent ceab6128fa
commit b40ea03f8a
42 changed files with 80 additions and 90 deletions

View File

@@ -34,7 +34,7 @@ rustc_index::newtype_index! {
}
impl CounterId {
pub const START: Self = Self::from_u32(0);
pub const START: Self = Self::ZERO;
}
rustc_index::newtype_index! {
@@ -56,7 +56,7 @@ rustc_index::newtype_index! {
}
impl ExpressionId {
pub const START: Self = Self::from_u32(0);
pub const START: Self = Self::ZERO;
}
/// Enum that can hold a constant zero value, the ID of an physical coverage