Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute macros can't be applied to statements #41475

Closed
abonander opened this issue Apr 23, 2017 · 1 comment · Fixed by #49124
Closed

Attribute macros can't be applied to statements #41475

abonander opened this issue Apr 23, 2017 · 1 comment · Fixed by #49124
Labels
A-macros-2.0 Area: Declarative macros 2.0 (#39412) C-bug Category: This is a bug.

Comments

@abonander
Copy link
Contributor

If my_attr is an attribute proc macro which otherwise resolves in a given context,
#[my_attr] let foo: i32; will fail to resolve.

I'm on mobile because my home internet is down so I can't really provide a better example. Will update later if necessary.

cc @jseyfried

@Mark-Simulacrum
Copy link
Member

@abonander Could you provide a full example, preferably on playpen, but since this involves proc macros I suspect that might not be possible?

@Mark-Simulacrum Mark-Simulacrum added the A-macros-2.0 Area: Declarative macros 2.0 (#39412) label Jun 23, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
abonander added a commit to abonander/rust that referenced this issue Apr 2, 2018
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions.

closes rust-lang#41475
cc rust-lang#38356
bors added a commit that referenced this issue Apr 2, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros-2.0 Area: Declarative macros 2.0 (#39412) C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants