Invoke attributes on the statement for statement items
This commit is contained in:
@@ -234,6 +234,15 @@ impl Annotatable {
|
||||
|
||||
pub fn derive_allowed(&self) -> bool {
|
||||
match *self {
|
||||
Annotatable::Stmt(ref stmt) => match stmt.kind {
|
||||
ast::StmtKind::Item(ref item) => match item.kind {
|
||||
ast::ItemKind::Struct(..)
|
||||
| ast::ItemKind::Enum(..)
|
||||
| ast::ItemKind::Union(..) => true,
|
||||
_ => false,
|
||||
},
|
||||
_ => false,
|
||||
},
|
||||
Annotatable::Item(ref item) => match item.kind {
|
||||
ast::ItemKind::Struct(..) | ast::ItemKind::Enum(..) | ast::ItemKind::Union(..) => {
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user