22use std:: fmt;
33use std:: fmt:: Debug ;
44
5- pub use rustc_ast:: attr:: data_structures:: * ;
6- use rustc_macros:: { Decodable , Encodable , PrintAttribute , StableHash } ;
5+ use rustc_macros:: { Decodable , Encodable , StableHash } ;
76use rustc_span:: { DesugaringKind , Span , Symbol , kw} ;
87use thin_vec:: ThinVec ;
98use tracing:: debug;
109
11- use crate :: attrs:: PrintAttribute ;
12-
13- #[ derive( Clone , Default , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
10+ #[ derive( Clone , Default , Debug , StableHash , Encodable , Decodable ) ]
1411pub struct Directive {
1512 pub is_rustc_attr : bool ,
1613 /// This is never nested more than once, i.e. the directives in this
@@ -109,7 +106,7 @@ impl CustomDiagnostic {
109106
110107/// Like [std::fmt::Arguments] this is a string that has been parsed into "pieces",
111108/// either as string pieces or dynamic arguments.
112- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
109+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
113110pub struct FormatString {
114111 pub input : Symbol ,
115112 pub span : Span ,
@@ -211,13 +208,13 @@ pub struct FormatArgs {
211208 pub generic_args : Vec < ( Symbol , String ) > = Vec :: new ( ) ,
212209}
213210
214- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
211+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
215212pub enum Piece {
216213 Lit ( Symbol ) ,
217214 Arg ( FormatArg ) ,
218215}
219216
220- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
217+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
221218pub enum FormatArg {
222219 // A generic parameter, like `{T}` if we're on the `From<T>` trait.
223220 GenericParam {
@@ -237,7 +234,7 @@ pub enum FormatArg {
237234}
238235
239236/// Represents the `on` filter in `#[rustc_on_unimplemented]`.
240- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
237+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
241238pub struct Filter {
242239 pub span : Span ,
243240 pub pred : Predicate ,
@@ -262,7 +259,7 @@ impl Filter {
262259///
263260/// It is similar to the predicate in the `cfg` attribute,
264261/// and may contain nested predicates.
265- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
262+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
266263pub enum Predicate {
267264 /// A condition like `on(crate_local)`.
268265 Flag ( Flag ) ,
@@ -300,7 +297,7 @@ impl Predicate {
300297}
301298
302299/// Represents a `MetaWord` in an `on`-filter.
303- #[ derive( Clone , Copy , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
300+ #[ derive( Clone , Copy , Debug , StableHash , Encodable , Decodable ) ]
304301pub enum Flag {
305302 /// Whether the code causing the trait bound to not be fulfilled
306303 /// is part of the user's crate.
@@ -315,7 +312,7 @@ pub enum Flag {
315312/// A `MetaNameValueStr` in an `on`-filter.
316313///
317314/// For example, `#[rustc_on_unimplemented(on(name = "value", message = "hello"))]`.
318- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
315+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
319316pub struct NameValue {
320317 pub name : Name ,
321318 /// Something like `"&str"` or `"alloc::string::String"`,
@@ -334,7 +331,7 @@ impl NameValue {
334331}
335332
336333/// The valid names of the `on` filter.
337- #[ derive( Clone , Copy , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
334+ #[ derive( Clone , Copy , Debug , StableHash , Encodable , Decodable ) ]
338335pub enum Name {
339336 Cause ,
340337 FromDesugaring ,
@@ -354,7 +351,7 @@ pub enum FlagOrNv<'p> {
354351/// If it is a simple literal like this then `pieces` will be `[LitOrArg::Lit("value")]`.
355352/// The `Arg` variant is used when it contains formatting like
356353/// `#[rustc_on_unimplemented(on(Self = "&[{A}]", message = "hello"))]`.
357- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
354+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
358355pub struct FilterFormatString {
359356 pub pieces : ThinVec < LitOrArg > ,
360357}
@@ -386,7 +383,7 @@ impl FilterFormatString {
386383 }
387384}
388385
389- #[ derive( Clone , Debug , StableHash , Encodable , Decodable , PrintAttribute ) ]
386+ #[ derive( Clone , Debug , StableHash , Encodable , Decodable ) ]
390387pub enum LitOrArg {
391388 Lit ( Symbol ) ,
392389 Arg ( Symbol ) ,
0 commit comments