From 91c3c2040ce109d6e9ea00ffb8e8f69f3fd6d9bb Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sun, 18 Dec 2022 21:22:14 +0100 Subject: Make `#[max]` an attribute in `newtype_index` --- compiler/rustc_middle/src/mir/coverage.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_middle/src/mir') diff --git a/compiler/rustc_middle/src/mir/coverage.rs b/compiler/rustc_middle/src/mir/coverage.rs index 173c8967eec..3025e2dd134 100644 --- a/compiler/rustc_middle/src/mir/coverage.rs +++ b/compiler/rustc_middle/src/mir/coverage.rs @@ -11,9 +11,9 @@ rustc_index::newtype_index! { /// (which _*descend*_ from u32::MAX). Id value `0` (zero) represents a virtual counter with a /// constant value of `0`. #[derive(HashStable)] + #[max = 0xFFFF_FFFF] pub struct ExpressionOperandId { DEBUG_FORMAT = "ExpressionOperandId({})", - MAX = 0xFFFF_FFFF, } } @@ -33,9 +33,9 @@ impl ExpressionOperandId { rustc_index::newtype_index! { #[derive(HashStable)] + #[max = 0xFFFF_FFFF] pub struct CounterValueReference { DEBUG_FORMAT = "CounterValueReference({})", - MAX = 0xFFFF_FFFF, } } @@ -57,9 +57,9 @@ rustc_index::newtype_index! { /// /// Values descend from u32::MAX. #[derive(HashStable)] + #[max = 0xFFFF_FFFF] pub struct InjectedExpressionId { DEBUG_FORMAT = "InjectedExpressionId({})", - MAX = 0xFFFF_FFFF, } } @@ -68,9 +68,9 @@ rustc_index::newtype_index! { /// /// Values ascend from 0. #[derive(HashStable)] + #[max = 0xFFFF_FFFF] pub struct InjectedExpressionIndex { DEBUG_FORMAT = "InjectedExpressionIndex({})", - MAX = 0xFFFF_FFFF, } } @@ -79,9 +79,9 @@ rustc_index::newtype_index! { /// 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)] + #[max = 0xFFFF_FFFF] pub struct MappedExpressionIndex { DEBUG_FORMAT = "MappedExpressionIndex({})", - MAX = 0xFFFF_FFFF, } } -- cgit 1.4.1-3-g733a5