Replace custom_encodable with encodable.
By default, `newtype_index!` types get a default `Encodable`/`Decodable` impl. You can opt out of this with `custom_encodable`. Opting out is the opposite to how Rust normally works with autogenerated (derived) impls. This commit inverts the behaviour, replacing `custom_encodable` with `encodable` which opts into the default `Encodable`/`Decodable` impl. Only 23 of the 59 `newtype_index!` occurrences need `encodable`. Even better, there were eight crates with a dependency on `rustc_serialize` just from unused default `Encodable`/`Decodable` impls. This commit removes that dependency from those eight crates.
This commit is contained in:
@@ -8,6 +8,7 @@ rustc_index::newtype_index! {
|
||||
/// This is later turned into [`DefId`] and `HirId` for the HIR.
|
||||
///
|
||||
/// [`DefId`]: rustc_span::def_id::DefId
|
||||
#[encodable]
|
||||
#[debug_format = "NodeId({})"]
|
||||
pub struct NodeId {
|
||||
/// The [`NodeId`] used to represent the root of the crate.
|
||||
|
||||
Reference in New Issue
Block a user