diff options
| author | bors <bors@rust-lang.org> | 2018-04-02 10:38:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-04-02 10:38:28 +0000 |
| commit | 097efa9a998d4f3a4aee3af126e8f8a9eba1ae07 (patch) | |
| tree | f213dd0246f87b52a73f2b1e3a5294382c2bdc3a /src/libsyntax_ext | |
| parent | 135f334e0a3177146f7417cee7ceaf405ffe732d (diff) | |
| parent | 7c0124dd357650acb9b7115a408712ea281d8d22 (diff) | |
| download | rust-097efa9a998d4f3a4aee3af126e8f8a9eba1ae07.tar.gz rust-097efa9a998d4f3a4aee3af126e8f8a9eba1ae07.zip | |
Auto merge of #49124 - abonander:attr-macro-stmt-expr, r=abonander
Expand Attributes on Statements and Expressions This enables attribute-macro expansion on statements and expressions while retaining the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356 @petrochenkov @jseyfried r? @nrc
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/custom.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax_ext/deriving/custom.rs b/src/libsyntax_ext/deriving/custom.rs index 22e78e9b426..80557078d54 100644 --- a/src/libsyntax_ext/deriving/custom.rs +++ b/src/libsyntax_ext/deriving/custom.rs @@ -54,7 +54,9 @@ impl MultiItemModifier for ProcMacroDerive { let item = match item { Annotatable::Item(item) => item, Annotatable::ImplItem(_) | - Annotatable::TraitItem(_) => { + Annotatable::TraitItem(_) | + Annotatable::Stmt(_) | + Annotatable::Expr(_) => { ecx.span_err(span, "proc-macro derives may only be \ applied to struct/enum items"); return Vec::new() |
