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

The meta fragment specifier is considered as a single TT. #34011

Open
LeoTestard opened this issue Jun 1, 2016 · 2 comments
Open

The meta fragment specifier is considered as a single TT. #34011

LeoTestard opened this issue Jun 1, 2016 · 2 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug.

Comments

@LeoTestard
Copy link
Contributor

At various locations of the FOLLOW sets analysis for macro_rules!, meta is considered as always matching a single TT. This is not the case: ident = ... and ident(...) are both valid metas.

That being said the only consequence of this is that meta can be followed by anything, and I think it's not unreasonable to assume that the syntax of meta will not be expanded in the future... But still, we might want to check that.

@durka
Copy link
Contributor

durka commented Jun 1, 2016

I think it's not unreasonable to assume that the syntax of meta will not be expanded in the future

It could happen.

@steveklabnik steveklabnik added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Jun 6, 2016
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 25, 2017
bors added a commit that referenced this issue Aug 17, 2019
syntax: Support modern attribute syntax in the `meta` matcher

Where "modern" means #57367:
```
PATH
PATH `(` TOKEN_STREAM `)`
PATH `[` TOKEN_STREAM `]`
PATH `{` TOKEN_STREAM `}`
```

Unfortunately, `meta` wasn't future-proofed using the `FOLLOW` token set like other matchers (#34011), so code like `$meta:meta {` or `$meta:meta [` may break, and we need a crater run to find out how often this happens in practice.

Closes #49629 (by fully supporting `meta` rather than removing it.)
Centril added a commit to Centril/rust that referenced this issue Oct 1, 2019
syntax: Support modern attribute syntax in the `meta` matcher

Where "modern" means rust-lang#57367:
```
PATH
PATH `(` TOKEN_STREAM `)`
PATH `[` TOKEN_STREAM `]`
PATH `{` TOKEN_STREAM `}`
```

Unfortunately, `meta` wasn't future-proofed using the `FOLLOW` token set like other matchers (rust-lang#34011), so code like `$meta:meta {` or `$meta:meta [` may break, and we need a crater run to find out how often this happens in practice.

Closes rust-lang#49629 (by fully supporting `meta` rather than removing it.)
Centril added a commit to Centril/rust that referenced this issue Oct 1, 2019
syntax: Support modern attribute syntax in the `meta` matcher

Where "modern" means rust-lang#57367:
```
PATH
PATH `(` TOKEN_STREAM `)`
PATH `[` TOKEN_STREAM `]`
PATH `{` TOKEN_STREAM `}`
```

Unfortunately, `meta` wasn't future-proofed using the `FOLLOW` token set like other matchers (rust-lang#34011), so code like `$meta:meta {` or `$meta:meta [` may break, and we need a crater run to find out how often this happens in practice.

Closes rust-lang#49629 (by fully supporting `meta` rather than removing it.)
@steveklabnik
Copy link
Member

Triage: honestly, I'm not good enough with macros to know what exactly the details are here; it seems that #63764 expanded the syntax even with this roadblock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants