Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for arbitrary token streams in non-macro attributes (`unrestricted_attribute_tokens`) #55208
Comments
petrochenkov
self-assigned this
Oct 19, 2018
petrochenkov
added
T-lang
B-unstable
C-tracking-issue
labels
Oct 19, 2018
kennytm
referenced this issue
Nov 6, 2018
Closed
[WIP] Implement (possibly?) the entire Rust grammar. #13
Centril
added
A-attributes
A-macros
labels
Nov 10, 2018
This comment has been minimized.
This comment has been minimized.
|
I'm in favor of doing this change; all of it. But do we need this to go through an RFC first? |
This comment has been minimized.
This comment has been minimized.
flying-sheep
commented
Dec 3, 2018
|
I’m a bit confused: I want to use a macro invocation in the attribute value position, but apparently it doesn’t get expanded: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=14757b61cc384f085a63efea3002b96d The code compiles, but I have no idea what actually ends up in the attribute. |
This comment has been minimized.
This comment has been minimized.
|
@flying-sheep That's not supported - |
This comment has been minimized.
This comment has been minimized.
flying-sheep
commented
Dec 3, 2018
•
|
Do you know where early expansion is discussed? I’m also be happy with |
This comment has been minimized.
This comment has been minimized.
@eddyb But in this case you can only pass this to serde because an opt-in feature gate has been enabled; can you elaborate on the backwards compat concern? |
This comment has been minimized.
This comment has been minimized.
|
@Centril I was talking about (early) macro expansion in general, not this specific instance. But also, I'm pretty sure the intention is to allow free-form attribute input, which would make Meanwhile, opt-in early expansion proposals would work in this case, without attribute parsing or |
petrochenkov
referenced this issue
Jan 4, 2019
Merged
Implement basic input validation for built-in attributes #57321
bors
added a commit
that referenced
this issue
Jan 4, 2019
This comment has been minimized.
This comment has been minimized.
|
PR implementing the stabilization plan - #57321. |
petrochenkov
referenced this issue
Jan 6, 2019
Merged
Stabilize `unrestricted_attribute_tokens` #57367
This comment has been minimized.
This comment has been minimized.
|
Followup PR implementing the stabilization plan - #57367 |
petrochenkov commentedOct 19, 2018
•
edited
This issue tracks feature
unrestricted_attribute_tokensintroduced for future-compatibility during stabilization of macros 1.2.The feature allows using the full macro attribute grammar for non-macro attributes:
Additionally, the feature extends the grammar of value in key-value attributes (
#[key = "value"]) to arbitrary token trees:More information and proposed path to stabilization can be found in https://internals.rust-lang.org/t/unrestricted-attribute-tokens-feature-status/8561.