From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_middle/src/mir/coverage.rs | 43 ++++++++++++++----------------- 1 file changed, 19 insertions(+), 24 deletions(-) (limited to 'compiler/rustc_middle/src/mir/coverage.rs') 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 for ExpressionOperandId { -- cgit v1.2.3