1
Fork 0

Remove hir::ImplItem::attrs.

This commit is contained in:
Camille GILLOT 2020-11-27 09:55:10 +01:00
parent c49359add2
commit 5474f17011
13 changed files with 23 additions and 36 deletions

View file

@ -2090,7 +2090,6 @@ pub struct ImplItem<'hir> {
pub def_id: LocalDefId,
pub vis: Visibility<'hir>,
pub defaultness: Defaultness,
pub attrs: &'hir [Attribute],
pub generics: Generics<'hir>,
pub kind: ImplItemKind<'hir>,
pub span: Span,
@ -3080,6 +3079,6 @@ mod size_asserts {
rustc_data_structures::static_assert_size!(super::Item<'static>, 200);
rustc_data_structures::static_assert_size!(super::TraitItem<'static>, 128);
rustc_data_structures::static_assert_size!(super::ImplItem<'static>, 168);
rustc_data_structures::static_assert_size!(super::ImplItem<'static>, 152);
rustc_data_structures::static_assert_size!(super::ForeignItem<'static>, 136);
}

View file

@ -988,16 +988,8 @@ pub fn walk_trait_item_ref<'v, V: Visitor<'v>>(visitor: &mut V, trait_item_ref:
pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplItem<'v>) {
// N.B., deliberately force a compilation error if/when new fields are added.
let ImplItem {
def_id: _,
ident,
ref vis,
ref defaultness,
attrs: _,
ref generics,
ref kind,
span: _,
} = *impl_item;
let ImplItem { def_id: _, ident, ref vis, ref defaultness, ref generics, ref kind, span: _ } =
*impl_item;
visitor.visit_ident(ident);
visitor.visit_vis(vis);

View file

@ -152,22 +152,13 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitItem<'_> {
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ImplItem<'_> {
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
let ImplItem {
def_id: _,
ident,
ref vis,
defaultness,
ref attrs,
ref generics,
ref kind,
span,
} = *self;
let ImplItem { def_id: _, ident, ref vis, defaultness, ref generics, ref kind, span } =
*self;
hcx.hash_hir_item_like(|hcx| {
ident.name.hash_stable(hcx, hasher);
vis.hash_stable(hcx, hasher);
defaultness.hash_stable(hcx, hasher);
attrs.hash_stable(hcx, hasher);
generics.hash_stable(hcx, hasher);
kind.hash_stable(hcx, hasher);
span.hash_stable(hcx, hasher);