diff options
Diffstat (limited to 'src/librustc/ich/impls_syntax.rs')
| -rw-r--r-- | src/librustc/ich/impls_syntax.rs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index 304735fb1c7..aa147462e3d 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -177,7 +177,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for [ast::Attribute] { let filtered: SmallVec<[&ast::Attribute; 8]> = self .iter() .filter(|attr| { - !attr.is_sugared_doc && + !attr.is_doc_comment() && !attr.ident().map_or(false, |ident| hcx.is_ignored_attr(ident.name)) }) .collect(); @@ -207,19 +207,16 @@ impl<'a> HashStable<StableHashingContext<'a>> for ast::Attribute { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { // Make sure that these have been filtered out. debug_assert!(!self.ident().map_or(false, |ident| hcx.is_ignored_attr(ident.name))); - debug_assert!(!self.is_sugared_doc); - - let ast::Attribute { - ref item, - id: _, - style, - is_sugared_doc: _, - span, - } = *self; - - item.hash_stable(hcx, hasher); - style.hash_stable(hcx, hasher); - span.hash_stable(hcx, hasher); + debug_assert!(!self.is_doc_comment()); + + let ast::Attribute { kind, id: _, style, span } = self; + if let ast::AttrKind::Normal(item) = kind { + item.hash_stable(hcx, hasher); + style.hash_stable(hcx, hasher); + span.hash_stable(hcx, hasher); + } else { + unreachable!(); + } } } |
