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

Decide what we want about macro_metavar_expr #137581

Open
traviscross opened this issue Feb 25, 2025 · 1 comment
Open

Decide what we want about macro_metavar_expr #137581

traviscross opened this issue Feb 25, 2025 · 1 comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. F-macro_metavar_expr `#![feature(macro_metavar_expr)]` I-lang-radar Items that are on lang's radar and will need eventual work or consideration. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@traviscross
Copy link
Contributor

traviscross commented Feb 25, 2025

The author of the stabilization PR for macro_metavar_expr has apparently lost interest in further pursuing it:

We've reopened it for now, but probably it'll need a new PR regardless. To clear the way for that, probably we should decide what it is that we want to see here. Let's use this issue to track our answering of that.

@rustbot labels +T-lang +C-discussion

cc @rust-lang/lang @rust-lang/wg-macros

@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. C-discussion Category: Discussion or questions that doesn't represent real issues. I-lang-nominated Nominated for discussion during a lang team meeting. T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Feb 25, 2025
@traviscross traviscross removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Feb 25, 2025
@traviscross traviscross removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 25, 2025
@fmease fmease added the F-macro_metavar_expr `#![feature(macro_metavar_expr)]` label Feb 25, 2025
@tgross35
Copy link
Contributor

tgross35 commented Feb 25, 2025

Would it be possible to consider rust-lang/rfcs#3649 as an alternative here? It helps resolve the confusing numeric indexing, and it eliminates the need for having both of the similar count and len operators. (Also ignore is unneeded).

The reference-level explanation also spells out a more concrete set of rules for how metavariables need to behave in less straightforward cases. I haven't seen something similar for metavar expressions in their current state but it would probably help to draw that out. (I do address this to some extent in "Changes from current implementation" bullets).

Note that the RFC is still not completely polished yet, but I believe it is thorough enough to be discussed.

@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. F-macro_metavar_expr `#![feature(macro_metavar_expr)]` I-lang-radar Items that are on lang's radar and will need eventual work or consideration. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants