Tracking Issue for `macro_metavar_expr_concat`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
This is a tracking issue for the experimental feature macro metavariable expression concat (RFC pending).
The feature gate for the issue is #![feature(macro_metavar_expr_concat)].
Provides a modern alternative to the concat_idents! macro.
#![feature(macro_metavar_expr_concat)]
macro_rules! many_idents {
($a:ident, $c:ident) => {
const ${concat($a, B, $c, D)}: i32 = 1;
};
}
fn main() {
many_idents!(A, C);
assert_eq!(ABCD, 1);
}
About experimental features
An experimental feature is one that has not yet had an RFC. The idea is to allow implementation work to proceed to better inform an upcoming RFC. Experimental features cannot be stabilized without first having an RFC. The existence of an experimental feature does not indicate lang team consensus that the feature is desirable, only that there is a problem that is worthy of being solved and that the idea has enough merit to consider exploring. See the lang team process page for more details.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps / History
- Implementation (https://github.com/rust-lang/rust/pull/118958)
- Write an RFC
- Adjust documentation (see instructions on rustc-dev-guide)
- Formatting for new syntax has been added to the Style Guide (nightly-style-procedure)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- Should the syntax use commas? https://github.com/rust-lang/rust/pull/118958#discussion_r1435269076
- Should numeric literals be allowed? (yes) https://github.com/rust-lang/rust/pull/118958#discussion_r1520260272
- Which span should the resulting identifier have? Should it be related to the macro, the concatenated values, or customizable? https://github.com/rust-lang/rust/pull/118958#discussion_r1572498354
- What should be done with
r#fooraw identifiers? https://github.com/rust-lang/rust/pull/118958#discussion_r1638431513
References
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with this tracking issue and the implementation in PR 118958, then review the linked rustc-dev-guide stabilization and documentation guidance. The remaining work spans an RFC, documentation, Style Guide formatting, unresolved syntax and span questions, and eventual stabilization; done means the relevant checklist items and design questions are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 24/100