1
Fork 0

Remove TraitDef::attributes.

Because it's always empty.
This commit is contained in:
Nicholas Nethercote 2022-08-17 12:20:25 +10:00
parent 5746c752f4
commit 2c24958cfd
12 changed files with 2 additions and 17 deletions

View file

@ -184,8 +184,6 @@ pub struct TraitDef<'a> {
/// The span for the current #[derive(Foo)] header.
pub span: Span,
pub attributes: Vec<ast::Attribute>,
/// Path of the trait, including any type parameters
pub path: Path,
@ -718,15 +716,13 @@ impl<'a> TraitDef<'a> {
let self_type = cx.ty_path(path);
let attr = cx.attribute(cx.meta_word(self.span, sym::automatically_derived));
let attrs = vec![attr];
let opt_trait_ref = Some(trait_ref);
let mut a = vec![attr];
a.extend(self.attributes.iter().cloned());
cx.item(
self.span,
Ident::empty(),
a,
attrs,
ast::ItemKind::Impl(Box::new(ast::Impl {
unsafety: ast::Unsafe::No,
polarity: ast::ImplPolarity::Positive,