diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /compiler/rustc_middle/src/mir/coverage.rs | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_middle/src/mir/coverage.rs | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/compiler/rustc_middle/src/mir/coverage.rs b/compiler/rustc_middle/src/mir/coverage.rs index efa946452..e7bb3ab0b 100644 --- a/compiler/rustc_middle/src/mir/coverage.rs +++ b/compiler/rustc_middle/src/mir/coverage.rs @@ -3,7 +3,6 @@ use rustc_macros::HashStable; use rustc_span::Symbol; -use std::cmp::Ord; use std::fmt::{self, Debug, Formatter}; rustc_index::newtype_index! { @@ -11,10 +10,10 @@ 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)] + #[max = 0xFFFF_FFFF] + #[debug_format = "ExpressionOperandId({})"] pub struct ExpressionOperandId { - derive [HashStable] - DEBUG_FORMAT = "ExpressionOperandId({})", - MAX = 0xFFFF_FFFF, } } @@ -33,11 +32,10 @@ impl ExpressionOperandId { } rustc_index::newtype_index! { - pub struct CounterValueReference { - derive [HashStable] - DEBUG_FORMAT = "CounterValueReference({})", - MAX = 0xFFFF_FFFF, - } + #[derive(HashStable)] + #[max = 0xFFFF_FFFF] + #[debug_format = "CounterValueReference({})"] + pub struct CounterValueReference {} } impl CounterValueReference { @@ -57,33 +55,30 @@ rustc_index::newtype_index! { /// InjectedExpressionId.as_u32() converts to ExpressionOperandId.as_u32() /// /// Values descend from u32::MAX. - pub struct InjectedExpressionId { - derive [HashStable] - DEBUG_FORMAT = "InjectedExpressionId({})", - MAX = 0xFFFF_FFFF, - } + #[derive(HashStable)] + #[max = 0xFFFF_FFFF] + #[debug_format = "InjectedExpressionId({})"] + pub struct InjectedExpressionId {} } rustc_index::newtype_index! { /// InjectedExpressionIndex.as_u32() translates to u32::MAX - ExpressionOperandId.as_u32() /// /// Values ascend from 0. - pub struct InjectedExpressionIndex { - derive [HashStable] - DEBUG_FORMAT = "InjectedExpressionIndex({})", - MAX = 0xFFFF_FFFF, - } + #[derive(HashStable)] + #[max = 0xFFFF_FFFF] + #[debug_format = "InjectedExpressionIndex({})"] + pub struct InjectedExpressionIndex {} } 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. - pub struct MappedExpressionIndex { - derive [HashStable] - DEBUG_FORMAT = "MappedExpressionIndex({})", - MAX = 0xFFFF_FFFF, - } + #[derive(HashStable)] + #[max = 0xFFFF_FFFF] + #[debug_format = "MappedExpressionIndex({})"] + pub struct MappedExpressionIndex {} } impl From<CounterValueReference> for ExpressionOperandId { |