Avoid specialization for AttrId deserialization

This commit is contained in:
bjorn3 2023-12-31 20:40:09 +00:00
parent 8d598b0d58
commit 47936b4813
4 changed files with 30 additions and 23 deletions

View file

@ -20,6 +20,7 @@
pub use crate::format::*;
pub use crate::util::parser::ExprPrecedence;
pub use rustc_span::AttrId;
pub use GenericArgs::*;
pub use UnsafeSource::*;
@ -30,7 +31,6 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_data_structures::sync::Lrc;
use rustc_macros::HashStable_Generic;
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use rustc_span::source_map::{respan, Spanned};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
@ -2682,22 +2682,6 @@ pub enum AttrStyle {
Inner,
}
rustc_index::newtype_index! {
#[orderable]
#[debug_format = "AttrId({})"]
pub struct AttrId {}
}
impl<S: Encoder> Encodable<S> for AttrId {
fn encode(&self, _s: &mut S) {}
}
impl<D: Decoder> Decodable<D> for AttrId {
default fn decode(_: &mut D) -> AttrId {
panic!("cannot decode `AttrId` with `{}`", std::any::type_name::<D>());
}
}
/// A list of attributes.
pub type AttrVec = ThinVec<Attribute>;