Use #[derive] instead of custom syntax in all newtype_index

This commit is contained in:
Nilstrieb
2022-12-18 20:53:08 +01:00
parent 37efc81072
commit b4d739ef12
7 changed files with 14 additions and 26 deletions

View File

@@ -10,8 +10,8 @@ rustc_index::newtype_index! {
/// CounterValueReference.as_u32() (which ascend from 1) or an ExpressionOperandId.as_u32()
/// (which _*descend*_ from u32::MAX). Id value `0` (zero) represents a virtual counter with a
/// constant value of `0`.
#[derive(HashStable)]
pub struct ExpressionOperandId {
derive [HashStable]
DEBUG_FORMAT = "ExpressionOperandId({})",
MAX = 0xFFFF_FFFF,
}
@@ -32,8 +32,8 @@ impl ExpressionOperandId {
}
rustc_index::newtype_index! {
#[derive(HashStable)]
pub struct CounterValueReference {
derive [HashStable]
DEBUG_FORMAT = "CounterValueReference({})",
MAX = 0xFFFF_FFFF,
}
@@ -56,8 +56,8 @@ rustc_index::newtype_index! {
/// InjectedExpressionId.as_u32() converts to ExpressionOperandId.as_u32()
///
/// Values descend from u32::MAX.
#[derive(HashStable)]
pub struct InjectedExpressionId {
derive [HashStable]
DEBUG_FORMAT = "InjectedExpressionId({})",
MAX = 0xFFFF_FFFF,
}
@@ -67,8 +67,8 @@ rustc_index::newtype_index! {
/// InjectedExpressionIndex.as_u32() translates to u32::MAX - ExpressionOperandId.as_u32()
///
/// Values ascend from 0.
#[derive(HashStable)]
pub struct InjectedExpressionIndex {
derive [HashStable]
DEBUG_FORMAT = "InjectedExpressionIndex({})",
MAX = 0xFFFF_FFFF,
}
@@ -78,8 +78,8 @@ rustc_index::newtype_index! {
/// MappedExpressionIndex values ascend from zero, and are recalculated indexes based on their
/// array position in the LLVM coverage map "Expressions" array, which is assembled during the
/// "mapgen" process. They cannot be computed algorithmically, from the other `newtype_index`s.
#[derive(HashStable)]
pub struct MappedExpressionIndex {
derive [HashStable]
DEBUG_FORMAT = "MappedExpressionIndex({})",
MAX = 0xFFFF_FFFF,
}