-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[RFC-3086] Add a new concat
metavar expr
#111930
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
cc @petrochenkov in case you want to add something |
Well, no-one seemed interested so I will close this PR. At least I tried 🤷 |
I think there's a chance that you can bring this new meta-var expr to the attention of more people by opening a new Zulip topic in the T-lang stream for example. |
Hum... Some of my previous attempts trying to introduce new features resulted in a simple "no" or a feedback delay of +1 year, which doesn't give me the motivation to continue pursuing this PR. In order to get more changes of success, the overall plan is to write a RFC addressing the remaining concerns of #83527 as well as including any other useful meta variable expression (including |
I don't know who's in charge of this feature, but I don't know enough about it to review this. I didn't even know there was an RFC and that it was accepted. I should still not have left the PR in limbo, I apologize for that. Looking through the tracking issue, there seems to be no one really in charge of getting the feature implemented. While I can review the implementation, I do not want to make decisions on the language side of a feature I don't really know and don't have the time to get to know. Considering that (from the tracking issue discussion), you are the expert on this feature, you can just make feature decisions and we'll get it reviewed from the impl side. Worst case this will make someone from the compiler team disagree with the changes enough to step up 😆 |
Oh, no need to apologize! My concerns were directed towards the big picture and such HR situation is common among open source projects. More like a feature than a bug :)
It is much easier and faster to write a PR describing the intention behind the code than elaborating a formal RFC but I am still not sure because different persons showed different opinions in the tracking issue. Let me collect more material to figure things out. |
In any case, I just want to say thanks for working on this! :) |
Add a new concat metavar expr Revival of rust-lang#111930 Giving it another try now that rust-lang#117050 was merged. With the new rules, meta-variable expressions must be referenced with a dollar sign (`$`) and this can cause misunderstands with `$concat`. ```rust macro_rules! foo { ( $bar:ident ) => { const ${concat(VAR, bar)}: i32 = 1; }; } // Will produce `VARbar` instead of `VAR_123` foo!(_123); ``` In other words, forgetting the dollar symbol can produce undesired outputs. cc rust-lang#29599 cc rust-lang#124225
While investigating the blockers for the stabilization of #83527, I figured it would probably be nice to have a way to concatenate identifiers as well as literals without having to use third-parties or
concat_idents!
.The intention here is to allow further experimentation of a nightly feature to gather more feedback. If such thing is not desired, needs a RFC or anything else, feel free to close this PR.
Implementation-wise, there are some things that still need to be tweaked.
concat_idents
#29599