about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir/coverage.rs
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-12-18 21:37:38 +0100
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-12-18 21:37:38 +0100
commitd679764fb6b84a5cb72f6a9c9fefce4c6b41f16c (patch)
tree926ed2d285303de0a64f833a46fee04744d0d7de /compiler/rustc_middle/src/mir/coverage.rs
parent91c3c2040ce109d6e9ea00ffb8e8f69f3fd6d9bb (diff)
downloadrust-d679764fb6b84a5cb72f6a9c9fefce4c6b41f16c.tar.gz
rust-d679764fb6b84a5cb72f6a9c9fefce4c6b41f16c.zip
Make `#[debug_format]` an attribute in `newtype_index`
This removes the `custom` format functionality as its only user was
trivially migrated to using a normal format.

If a new use case for a custom formatting impl pops up, you can add it
back.
Diffstat (limited to 'compiler/rustc_middle/src/mir/coverage.rs')
-rw-r--r--compiler/rustc_middle/src/mir/coverage.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/mir/coverage.rs b/compiler/rustc_middle/src/mir/coverage.rs
index 3025e2dd134..8806077175b 100644
--- a/compiler/rustc_middle/src/mir/coverage.rs
+++ b/compiler/rustc_middle/src/mir/coverage.rs
@@ -12,8 +12,8 @@ rustc_index::newtype_index! {
     /// constant value of `0`.
     #[derive(HashStable)]
     #[max = 0xFFFF_FFFF]
+    #[debug_format = "ExpressionOperandId({})"]
     pub struct ExpressionOperandId {
-        DEBUG_FORMAT = "ExpressionOperandId({})",
     }
 }
 
@@ -34,8 +34,8 @@ impl ExpressionOperandId {
 rustc_index::newtype_index! {
     #[derive(HashStable)]
     #[max = 0xFFFF_FFFF]
+    #[debug_format = "CounterValueReference({})"]
     pub struct CounterValueReference {
-        DEBUG_FORMAT = "CounterValueReference({})",
     }
 }
 
@@ -58,8 +58,8 @@ rustc_index::newtype_index! {
     /// Values descend from u32::MAX.
     #[derive(HashStable)]
     #[max = 0xFFFF_FFFF]
+    #[debug_format = "InjectedExpressionId({})"]
     pub struct InjectedExpressionId {
-        DEBUG_FORMAT = "InjectedExpressionId({})",
     }
 }
 
@@ -69,8 +69,8 @@ rustc_index::newtype_index! {
     /// Values ascend from 0.
     #[derive(HashStable)]
     #[max = 0xFFFF_FFFF]
+    #[debug_format = "InjectedExpressionIndex({})"]
     pub struct InjectedExpressionIndex {
-        DEBUG_FORMAT = "InjectedExpressionIndex({})",
     }
 }
 
@@ -80,8 +80,8 @@ rustc_index::newtype_index! {
     /// "mapgen" process. They cannot be computed algorithmically, from the other `newtype_index`s.
     #[derive(HashStable)]
     #[max = 0xFFFF_FFFF]
+    #[debug_format = "MappedExpressionIndex({})"]
     pub struct MappedExpressionIndex {
-        DEBUG_FORMAT = "MappedExpressionIndex({})",
     }
 }