about summary refs log tree commit diff
path: root/compiler/rustc_ast/src
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_ast/src
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_ast/src')
-rw-r--r--compiler/rustc_ast/src/ast.rs2
-rw-r--r--compiler/rustc_ast/src/node_id.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 49649188f58..4140bff6e29 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -2555,8 +2555,8 @@ pub enum AttrStyle {
 
 rustc_index::newtype_index! {
     #[custom_encodable]
+    #[debug_format = "AttrId({})]"]
     pub struct AttrId {
-        DEBUG_FORMAT = "AttrId({})"
     }
 }
 
diff --git a/compiler/rustc_ast/src/node_id.rs b/compiler/rustc_ast/src/node_id.rs
index 7b5acc3f485..8ba6b8c2c33 100644
--- a/compiler/rustc_ast/src/node_id.rs
+++ b/compiler/rustc_ast/src/node_id.rs
@@ -8,8 +8,8 @@ rustc_index::newtype_index! {
     /// This is later turned into [`DefId`] and `HirId` for the HIR.
     ///
     /// [`DefId`]: rustc_span::def_id::DefId
+    #[debug_format = "NodeId({})"]
     pub struct NodeId {
-        DEBUG_FORMAT = "NodeId({})"
     }
 }