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:
Nicholas Nethercote 2023-11-21 16:35:26 +11:00
parent cc4bb0de20
commit 3ef9d4d0ed
29 changed files with 27 additions and 28 deletions

View file

@ -3524,7 +3524,6 @@ dependencies = [
"rustc_macros", "rustc_macros",
"rustc_middle", "rustc_middle",
"rustc_mir_dataflow", "rustc_mir_dataflow",
"rustc_serialize",
"rustc_session", "rustc_session",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",
@ -3935,7 +3934,6 @@ dependencies = [
"rustc_lint", "rustc_lint",
"rustc_macros", "rustc_macros",
"rustc_middle", "rustc_middle",
"rustc_serialize",
"rustc_session", "rustc_session",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",
@ -3998,7 +3996,6 @@ dependencies = [
"rustc_index", "rustc_index",
"rustc_macros", "rustc_macros",
"rustc_middle", "rustc_middle",
"rustc_serialize",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",
"smallvec", "smallvec",
@ -4216,7 +4213,6 @@ dependencies = [
"rustc_infer", "rustc_infer",
"rustc_macros", "rustc_macros",
"rustc_middle", "rustc_middle",
"rustc_serialize",
"rustc_session", "rustc_session",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",
@ -4240,7 +4236,6 @@ dependencies = [
"rustc_index", "rustc_index",
"rustc_macros", "rustc_macros",
"rustc_middle", "rustc_middle",
"rustc_serialize",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",
"smallvec", "smallvec",
@ -4267,7 +4262,6 @@ dependencies = [
"rustc_middle", "rustc_middle",
"rustc_mir_build", "rustc_mir_build",
"rustc_mir_dataflow", "rustc_mir_dataflow",
"rustc_serialize",
"rustc_session", "rustc_session",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",
@ -4341,7 +4335,6 @@ dependencies = [
"rustc_lexer", "rustc_lexer",
"rustc_macros", "rustc_macros",
"rustc_middle", "rustc_middle",
"rustc_serialize",
"rustc_session", "rustc_session",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",
@ -4565,7 +4558,6 @@ dependencies = [
"rustc_middle", "rustc_middle",
"rustc_parse_format", "rustc_parse_format",
"rustc_query_system", "rustc_query_system",
"rustc_serialize",
"rustc_session", "rustc_session",
"rustc_span", "rustc_span",
"rustc_target", "rustc_target",

View file

@ -2574,7 +2574,6 @@ pub enum AttrStyle {
} }
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[custom_encodable]
#[debug_format = "AttrId({})"] #[debug_format = "AttrId({})"]
pub struct AttrId {} pub struct AttrId {}
} }

View file

@ -8,6 +8,7 @@ rustc_index::newtype_index! {
/// This is later turned into [`DefId`] and `HirId` for the HIR. /// This is later turned into [`DefId`] and `HirId` for the HIR.
/// ///
/// [`DefId`]: rustc_span::def_id::DefId /// [`DefId`]: rustc_span::def_id::DefId
#[encodable]
#[debug_format = "NodeId({})"] #[debug_format = "NodeId({})"]
pub struct NodeId { pub struct NodeId {
/// The [`NodeId`] used to represent the root of the crate. /// The [`NodeId`] used to represent the root of the crate.

View file

@ -19,7 +19,6 @@ rustc_lexer = { path = "../rustc_lexer" }
rustc_macros = { path = "../rustc_macros" } rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" } rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }

View file

@ -189,8 +189,6 @@ impl GlobalFileTable {
} }
rustc_index::newtype_index! { rustc_index::newtype_index! {
// Tell the newtype macro to not generate `Encode`/`Decode` impls.
#[custom_encodable]
struct LocalFileId {} struct LocalFileId {}
} }

View file

@ -154,6 +154,7 @@ rustc_index::newtype_index! {
/// an "item-like" to something else can be implemented by a `Vec` instead of a /// an "item-like" to something else can be implemented by a `Vec` instead of a
/// tree or hash map. /// tree or hash map.
#[derive(HashStable_Generic)] #[derive(HashStable_Generic)]
#[encodable]
pub struct ItemLocalId {} pub struct ItemLocalId {}
} }

View file

@ -198,7 +198,6 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
// entire graph when there are many connected regions. // entire graph when there are many connected regions.
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[custom_encodable]
pub struct RegionId {} pub struct RegionId {}
} }

View file

@ -19,7 +19,6 @@ rustc_infer = { path = "../rustc_infer" }
rustc_lint = { path = "../rustc_lint" } rustc_lint = { path = "../rustc_lint" }
rustc_macros = { path = "../rustc_macros" } rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }

View file

@ -22,7 +22,7 @@ impl Parse for Newtype {
let mut debug_format: Option<Lit> = None; let mut debug_format: Option<Lit> = None;
let mut max = None; let mut max = None;
let mut consts = Vec::new(); let mut consts = Vec::new();
let mut encodable = true; let mut encodable = false;
let mut ord = true; let mut ord = true;
let mut gate_rustc_only = quote! {}; let mut gate_rustc_only = quote! {};
let mut gate_rustc_only_cfg = quote! { all() }; let mut gate_rustc_only_cfg = quote! { all() };
@ -34,8 +34,8 @@ impl Parse for Newtype {
gate_rustc_only_cfg = quote! { feature = "nightly" }; gate_rustc_only_cfg = quote! { feature = "nightly" };
false false
} }
"custom_encodable" => { "encodable" => {
encodable = false; encodable = true;
false false
} }
"no_ord_impl" => { "no_ord_impl" => {

View file

@ -15,7 +15,6 @@ rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" } rustc_index = { path = "../rustc_index" }
rustc_macros = { path = "../rustc_macros" } rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }

View file

@ -56,7 +56,6 @@ struct LintLevelSets {
} }
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[custom_encodable] // we don't need encoding
struct LintStackIndex { struct LintStackIndex {
const COMMAND_LINE = 0; const COMMAND_LINE = 0;
} }

View file

@ -148,6 +148,7 @@ rustc_index::newtype_index! {
/// * The subscope with `first_statement_index == 1` is scope of `c`, /// * The subscope with `first_statement_index == 1` is scope of `c`,
/// and thus does not include EXPR_2, but covers the `...`. /// and thus does not include EXPR_2, but covers the `...`.
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
pub struct FirstStatementIndex {} pub struct FirstStatementIndex {}
} }

View file

@ -17,6 +17,7 @@ rustc_index::newtype_index! {
/// Note that LLVM handles counter IDs as `uint32_t`, so there is no need /// Note that LLVM handles counter IDs as `uint32_t`, so there is no need
/// to use a larger representation on the Rust side. /// to use a larger representation on the Rust side.
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[max = 0xFFFF_FFFF] #[max = 0xFFFF_FFFF]
#[debug_format = "CounterId({})"] #[debug_format = "CounterId({})"]
pub struct CounterId {} pub struct CounterId {}
@ -37,6 +38,7 @@ rustc_index::newtype_index! {
/// Note that LLVM handles expression IDs as `uint32_t`, so there is no need /// Note that LLVM handles expression IDs as `uint32_t`, so there is no need
/// to use a larger representation on the Rust side. /// to use a larger representation on the Rust side.
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[max = 0xFFFF_FFFF] #[max = 0xFFFF_FFFF]
#[debug_format = "ExpressionId({})"] #[debug_format = "ExpressionId({})"]
pub struct ExpressionId {} pub struct ExpressionId {}

View file

@ -736,6 +736,7 @@ impl SourceInfo {
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[debug_format = "_{}"] #[debug_format = "_{}"]
pub struct Local { pub struct Local {
const RETURN_PLACE = 0; const RETURN_PLACE = 0;
@ -1171,6 +1172,7 @@ rustc_index::newtype_index! {
/// [`CriticalCallEdges`]: ../../rustc_const_eval/transform/add_call_guards/enum.AddCallGuards.html#variant.CriticalCallEdges /// [`CriticalCallEdges`]: ../../rustc_const_eval/transform/add_call_guards/enum.AddCallGuards.html#variant.CriticalCallEdges
/// [guide-mir]: https://rustc-dev-guide.rust-lang.org/mir/ /// [guide-mir]: https://rustc-dev-guide.rust-lang.org/mir/
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[debug_format = "bb{}"] #[debug_format = "bb{}"]
pub struct BasicBlock { pub struct BasicBlock {
const START_BLOCK = 0; const START_BLOCK = 0;
@ -1305,6 +1307,7 @@ impl<'tcx> BasicBlockData<'tcx> {
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[debug_format = "scope[{}]"] #[debug_format = "scope[{}]"]
pub struct SourceScope { pub struct SourceScope {
const OUTERMOST_SOURCE_SCOPE = 0; const OUTERMOST_SOURCE_SCOPE = 0;
@ -1533,6 +1536,7 @@ impl UserTypeProjection {
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[debug_format = "promoted[{}]"] #[debug_format = "promoted[{}]"]
pub struct Promoted {} pub struct Promoted {}
} }

View file

@ -132,6 +132,7 @@ pub struct UnsafetyCheckResult {
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[debug_format = "_{}"] #[debug_format = "_{}"]
pub struct CoroutineSavedLocal {} pub struct CoroutineSavedLocal {}
} }

View file

@ -1612,6 +1612,7 @@ impl fmt::Debug for EarlyParamRegion {
rustc_index::newtype_index! { rustc_index::newtype_index! {
/// A **region** (lifetime) **v**ariable **ID**. /// A **region** (lifetime) **v**ariable **ID**.
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[debug_format = "'?{}"] #[debug_format = "'?{}"]
pub struct RegionVid {} pub struct RegionVid {}
} }

View file

@ -578,6 +578,7 @@ impl<'a, V> LocalTableInContextMut<'a, V> {
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[derive(HashStable)] #[derive(HashStable)]
#[encodable]
#[debug_format = "UserType({})"] #[debug_format = "UserType({})"]
pub struct UserTypeAnnotationIndex { pub struct UserTypeAnnotationIndex {
const START_INDEX = 0; const START_INDEX = 0;

View file

@ -17,7 +17,6 @@ rustc_index = { path = "../rustc_index" }
rustc_infer = { path = "../rustc_infer" } rustc_infer = { path = "../rustc_infer" }
rustc_macros = { path = "../rustc_macros" } rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }

View file

@ -16,7 +16,6 @@ rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" } rustc_index = { path = "../rustc_index" }
rustc_macros = { path = "../rustc_macros" } rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }

View file

@ -20,7 +20,6 @@ rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_mir_build = { path = "../rustc_mir_build" } rustc_mir_build = { path = "../rustc_mir_build" }
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" } rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }

View file

@ -19,7 +19,6 @@ rustc_index = { path = "../rustc_index" }
rustc_lexer = { path = "../rustc_lexer" } rustc_lexer = { path = "../rustc_lexer" }
rustc_macros = { path = "../rustc_macros" } rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }

View file

@ -54,6 +54,7 @@ use std::marker::PhantomData;
// unused so that we can store multiple index types in `CompressedHybridIndex`, // unused so that we can store multiple index types in `CompressedHybridIndex`,
// and use those bits to encode which index type it contains. // and use those bits to encode which index type it contains.
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[encodable]
#[max = 0x7FFF_FFFF] #[max = 0x7FFF_FFFF]
pub struct SerializedDepNodeIndex {} pub struct SerializedDepNodeIndex {}
} }

View file

@ -13,7 +13,6 @@ pub type StableCrateIdMap =
indexmap::IndexMap<StableCrateId, CrateNum, BuildHasherDefault<Unhasher>>; indexmap::IndexMap<StableCrateId, CrateNum, BuildHasherDefault<Unhasher>>;
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[custom_encodable]
#[debug_format = "crate{}"] #[debug_format = "crate{}"]
pub struct CrateNum {} pub struct CrateNum {}
} }
@ -213,7 +212,6 @@ rustc_index::newtype_index! {
/// A DefIndex is an index into the hir-map for a crate, identifying a /// A DefIndex is an index into the hir-map for a crate, identifying a
/// particular definition. It should really be considered an interned /// particular definition. It should really be considered an interned
/// shorthand for a particular DefPath. /// shorthand for a particular DefPath.
#[custom_encodable] // (only encodable in metadata)
#[debug_format = "DefIndex({})"] #[debug_format = "DefIndex({})"]
pub struct DefIndex { pub struct DefIndex {
/// The crate root is always assigned index 0 by the AST Map code, /// The crate root is always assigned index 0 by the AST Map code,
@ -222,6 +220,7 @@ rustc_index::newtype_index! {
} }
} }
// njn: I don't understand these
impl<E: Encoder> Encodable<E> for DefIndex { impl<E: Encoder> Encodable<E> for DefIndex {
default fn encode(&self, _: &mut E) { default fn encode(&self, _: &mut E) {
panic!("cannot encode `DefIndex` with `{}`", std::any::type_name::<E>()); panic!("cannot encode `DefIndex` with `{}`", std::any::type_name::<E>());

View file

@ -60,7 +60,6 @@ pub struct SyntaxContextData {
rustc_index::newtype_index! { rustc_index::newtype_index! {
/// A unique ID associated with a macro invocation and expansion. /// A unique ID associated with a macro invocation and expansion.
#[custom_encodable]
pub struct ExpnIndex {} pub struct ExpnIndex {}
} }
@ -80,7 +79,6 @@ impl fmt::Debug for ExpnId {
rustc_index::newtype_index! { rustc_index::newtype_index! {
/// A unique ID associated with a macro invocation and expansion. /// A unique ID associated with a macro invocation and expansion.
#[custom_encodable]
#[no_ord_impl] #[no_ord_impl]
#[debug_format = "expn{}"] #[debug_format = "expn{}"]
pub struct LocalExpnId {} pub struct LocalExpnId {}

View file

@ -42,6 +42,7 @@ rustc_index::newtype_index! {
/// `d` is `FieldIdx(1)` in `VariantIdx(1)`, and /// `d` is `FieldIdx(1)` in `VariantIdx(1)`, and
/// `f` is `FieldIdx(1)` in `VariantIdx(0)`. /// `f` is `FieldIdx(1)` in `VariantIdx(0)`.
#[derive(HashStable_Generic)] #[derive(HashStable_Generic)]
#[encodable]
pub struct FieldIdx {} pub struct FieldIdx {}
} }
@ -57,6 +58,7 @@ rustc_index::newtype_index! {
/// `struct`s, `tuples`, and `unions`s are considered to have a single variant /// `struct`s, `tuples`, and `unions`s are considered to have a single variant
/// with variant index zero, aka [`FIRST_VARIANT`]. /// with variant index zero, aka [`FIRST_VARIANT`].
#[derive(HashStable_Generic)] #[derive(HashStable_Generic)]
#[encodable]
pub struct VariantIdx { pub struct VariantIdx {
/// Equivalent to `VariantIdx(0)`. /// Equivalent to `VariantIdx(0)`.
const FIRST_VARIANT = 0; const FIRST_VARIANT = 0;

View file

@ -17,7 +17,6 @@ rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_parse_format = { path = "../rustc_parse_format" } rustc_parse_format = { path = "../rustc_parse_format" }
rustc_query_system = { path = "../rustc_query_system" } rustc_query_system = { path = "../rustc_query_system" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" } rustc_target = { path = "../rustc_target" }

View file

@ -95,6 +95,7 @@ impl<I: Interner> DebugWithInfcx<I> for ConstKind<I> {
rustc_index::newtype_index! { rustc_index::newtype_index! {
/// A **`const`** **v**ariable **ID**. /// A **`const`** **v**ariable **ID**.
#[encodable]
#[debug_format = "?{}c"] #[debug_format = "?{}c"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct ConstVid {} pub struct ConstVid {}
@ -108,6 +109,7 @@ rustc_index::newtype_index! {
/// relate an effect variable with a normal one, we would ICE, which can catch bugs /// relate an effect variable with a normal one, we would ICE, which can catch bugs
/// where we are not correctly using the effect var for an effect param. Fallback /// where we are not correctly using the effect var for an effect param. Fallback
/// is also implemented on top of having separate effect and normal const variables. /// is also implemented on top of having separate effect and normal const variables.
#[encodable]
#[debug_format = "?{}e"] #[debug_format = "?{}e"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct EffectVid {} pub struct EffectVid {}

View file

@ -92,6 +92,7 @@ rustc_index::newtype_index! {
/// ///
/// [dbi]: https://en.wikipedia.org/wiki/De_Bruijn_index /// [dbi]: https://en.wikipedia.org/wiki/De_Bruijn_index
#[cfg_attr(feature = "nightly", derive(HashStable_NoContext))] #[cfg_attr(feature = "nightly", derive(HashStable_NoContext))]
#[encodable]
#[debug_format = "DebruijnIndex({})"] #[debug_format = "DebruijnIndex({})"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct DebruijnIndex { pub struct DebruijnIndex {
@ -293,6 +294,7 @@ rustc_index::newtype_index! {
/// type -- an idealized representative of "types in general" that we /// type -- an idealized representative of "types in general" that we
/// use for checking generic functions. /// use for checking generic functions.
#[cfg_attr(feature = "nightly", derive(HashStable_NoContext))] #[cfg_attr(feature = "nightly", derive(HashStable_NoContext))]
#[encodable]
#[debug_format = "U{}"] #[debug_format = "U{}"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct UniverseIndex {} pub struct UniverseIndex {}
@ -335,6 +337,7 @@ impl UniverseIndex {
rustc_index::newtype_index! { rustc_index::newtype_index! {
#[cfg_attr(feature = "nightly", derive(HashStable_NoContext))] #[cfg_attr(feature = "nightly", derive(HashStable_NoContext))]
#[encodable]
#[debug_format = "{}"] #[debug_format = "{}"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct BoundVar {} pub struct BoundVar {}

View file

@ -622,6 +622,7 @@ pub struct FloatVarValue(pub FloatTy);
rustc_index::newtype_index! { rustc_index::newtype_index! {
/// A **ty**pe **v**ariable **ID**. /// A **ty**pe **v**ariable **ID**.
#[encodable]
#[debug_format = "?{}t"] #[debug_format = "?{}t"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct TyVid {} pub struct TyVid {}
@ -629,6 +630,7 @@ rustc_index::newtype_index! {
rustc_index::newtype_index! { rustc_index::newtype_index! {
/// An **int**egral (`u32`, `i32`, `usize`, etc.) type **v**ariable **ID**. /// An **int**egral (`u32`, `i32`, `usize`, etc.) type **v**ariable **ID**.
#[encodable]
#[debug_format = "?{}i"] #[debug_format = "?{}i"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct IntVid {} pub struct IntVid {}
@ -636,6 +638,7 @@ rustc_index::newtype_index! {
rustc_index::newtype_index! { rustc_index::newtype_index! {
/// A **float**ing-point (`f32` or `f64`) type **v**ariable **ID**. /// A **float**ing-point (`f32` or `f64`) type **v**ariable **ID**.
#[encodable]
#[debug_format = "?{}f"] #[debug_format = "?{}f"]
#[gate_rustc_only] #[gate_rustc_only]
pub struct FloatVid {} pub struct FloatVid {}