pub(crate) fn invalid_attr(attr: &Attribute) -> Diagnostic
Returns an error diagnostic for an invalid attribute.