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.
This commit is contained in:
parent
91c3c2040c
commit
d679764fb6
24 changed files with 64 additions and 92 deletions
|
@ -11,8 +11,8 @@ use std::hash::{Hash, Hasher};
|
|||
|
||||
rustc_index::newtype_index! {
|
||||
#[custom_encodable]
|
||||
#[debug_format = "crate{}"]
|
||||
pub struct CrateNum {
|
||||
DEBUG_FORMAT = "crate{}"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,8 +195,8 @@ rustc_index::newtype_index! {
|
|||
/// particular definition. It should really be considered an interned
|
||||
/// shorthand for a particular DefPath.
|
||||
#[custom_encodable] // (only encodable in metadata)
|
||||
#[debug_format = "DefIndex({})"]
|
||||
pub struct DefIndex {
|
||||
DEBUG_FORMAT = "DefIndex({})",
|
||||
/// The crate root is always assigned index 0 by the AST Map code,
|
||||
/// thanks to `NodeCollector::new`.
|
||||
const CRATE_DEF_INDEX = 0,
|
||||
|
|
|
@ -84,8 +84,8 @@ rustc_index::newtype_index! {
|
|||
/// A unique ID associated with a macro invocation and expansion.
|
||||
#[custom_encodable]
|
||||
#[no_ord_impl]
|
||||
#[debug_format = "expn{}"]
|
||||
pub struct LocalExpnId {
|
||||
DEBUG_FORMAT = "expn{}"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue