Skip to content

Conversation

tgross35
Copy link
Contributor

concat_idents has been around unstably for a long time, but there is now a better (but still unstable) way to join identifiers using ${concat(...)} syntax with macro_metavar_expr_concat. This resolves a lot of the problems with concat_idents and is on a better track toward stabilization, so there is no need to keep both versions around. concat_idents! still has a lot of use in the ecosystem so deprecate it before removing, as discussed in 1.

Link: #124225

@rustbot
Copy link
Collaborator

rustbot commented Feb 26, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 26, 2025
@tgross35 tgross35 changed the title Mark concat_idents! deprecated Deprecate concat_idents! Feb 26, 2025
@tgross35
Copy link
Contributor Author

r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Feb 26, 2025
@rustbot rustbot assigned m-ou-se and unassigned nnethercote Feb 26, 2025
@tgross35 tgross35 changed the title Deprecate concat_idents! Deprecate the unstable concat_idents! Feb 26, 2025
@tgross35 tgross35 force-pushed the deprecate-concat_idents branch from ecac1cc to 4f7ea23 Compare February 26, 2025 04:49
@tgross35 tgross35 added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Mar 6, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Mar 6, 2025

I'd like to propose deprecating it now (1.87) and removing in the next version (1.88), nominating for libs-api. Cc @rust-lang/lang since this is tightly coupled.

@traviscross traviscross added T-lang Relevant to the language team I-lang-nominated Nominated for discussion during a lang team meeting. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 6, 2025
@traviscross
Copy link
Contributor

Let's just FCP it. That's maybe weird for an unstable thing, but no more weird than doing a deprecation cycle for it.

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Mar 6, 2025

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Mar 6, 2025
@traviscross traviscross added the I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination label Mar 6, 2025
@nikomatsakis
Copy link
Contributor

@rfcbot reviewed

@joshtriplett
Copy link
Member

👍 for deprecating concat_idents!, in favor of concat from macro metavar expressions.

I saw that @tgross35 proposed rust-lang/rfcs#3649 to supersede the count and len mechanism. I want to make sure that RFC 3649 is only being proposed as an alternative to count and len, and that concat is still on track to continue.

@tgross35
Copy link
Contributor Author

I saw that @tgross35 proposed rust-lang/rfcs#3649 to supersede the count and len mechanism. I want to make sure that RFC 3649 is only being proposed as an alternative to count and len, and that concat is still on track to continue.

That's correct; I think concat can move forward at any point, RFC 3649 just handles the group- and index-related things 👍

@traviscross
Copy link
Contributor

traviscross commented Mar 12, 2025

@rustbot labels -I-lang-nominated

We discussed this in the lang call today. Thanks @tgross35 for pushing this forward.

As above, the one question that came up was whether this was related to our open question:

But it's not, as macro_metavar_expr_concat is under a separate feature flag and isn't part of that proposed stabilization.

@rustbot rustbot removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Mar 12, 2025
@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Mar 13, 2025
@rfcbot
Copy link

rfcbot commented Mar 13, 2025

🔔 This is now entering its final comment period, as per the review above. 🔔

`concat_idents` has been around unstably for a long time, but there is
now a better (but still unstable) way to join identifiers using
`${concat(...)}` syntax with `macro_metavar_expr_concat`. This resolves
a lot of the problems with `concat_idents` and is on a better track
toward stabilization, so there is no need to keep both versions around.
`concat_idents!` still has a lot of use in the ecosystem so deprecate it
before removing, as discussed in [1].

Link: rust-lang#124225
[1]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Removing.20.60concat_idents.60
@tgross35 tgross35 force-pushed the deprecate-concat_idents branch from 3f7d833 to 75a9be6 Compare April 24, 2025 22:14
@tgross35
Copy link
Contributor Author

@bors r=workingjubilee

@bors
Copy link
Collaborator

bors commented Apr 24, 2025

📌 Commit 75a9be6 has been approved by workingjubilee

It is now in the queue for this repository.

@cuviper
Copy link
Member

cuviper commented Apr 24, 2025

It would be nice if deprecated supported RUSTC_CURRENT_VERSION

Hmm, I think that should work -- the tool simply calls str::replace:

let new_contents = contents.replace(VERSION_PLACEHOLDER, version_str);

(although the placeholder is CURRENT_RUSTC_VERSION)

@tgross35
Copy link
Contributor Author

I did try it before and IIRC it got rejected somewhere for not being a valid version. But maybe I just made the same typo at that time too :)

@cuviper
Copy link
Member

cuviper commented Apr 24, 2025

Oh, I didn't think about attribute validation -- you're right, it doesn't work, and it should!

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137653 (Deprecate the unstable `concat_idents!`)
 - rust-lang#138957 (Update the index of Option to make the summary more comprehensive)
 - rust-lang#140006 (ensure compiler existance of tools on the dist step)
 - rust-lang#140143 (Move `sys::pal::os::Env` into `sys::env`)
 - rust-lang#140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/)
 - rust-lang#140236 (norm nested aliases before evaluating the parent goal)
 - rust-lang#140257 (Some drive-by housecleaning in `rustc_borrowck`)
 - rust-lang#140278 (Don't use item name to look up associated item from trait item)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 84a921d into rust-lang:master Apr 25, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 25, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2025
Rollup merge of rust-lang#137653 - tgross35:deprecate-concat_idents, r=workingjubilee

Deprecate the unstable `concat_idents!`

`concat_idents` has been around unstably for a long time, but there is now a better (but still unstable) way to join identifiers using `${concat(...)}` syntax with `macro_metavar_expr_concat`. This resolves a lot of the problems with `concat_idents` and is on a better track toward stabilization, so there is no need to keep both versions around. `concat_idents!` still has a lot of use in the ecosystem so deprecate it before removing, as discussed in [1].

Link: rust-lang#124225

[1]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Removing.20.60concat_idents.60
@tgross35 tgross35 deleted the deprecate-concat_idents branch April 25, 2025 15:53
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request May 9, 2025
…r=workingjubilee

Deprecate the unstable `concat_idents!`

`concat_idents` has been around unstably for a long time, but there is now a better (but still unstable) way to join identifiers using `${concat(...)}` syntax with `macro_metavar_expr_concat`. This resolves a lot of the problems with `concat_idents` and is on a better track toward stabilization, so there is no need to keep both versions around. `concat_idents!` still has a lot of use in the ecosystem so deprecate it before removing, as discussed in [1].

Link: rust-lang#124225

[1]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Removing.20.60concat_idents.60
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request May 9, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137653 (Deprecate the unstable `concat_idents!`)
 - rust-lang#138957 (Update the index of Option to make the summary more comprehensive)
 - rust-lang#140006 (ensure compiler existance of tools on the dist step)
 - rust-lang#140143 (Move `sys::pal::os::Env` into `sys::env`)
 - rust-lang#140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/)
 - rust-lang#140236 (norm nested aliases before evaluating the parent goal)
 - rust-lang#140257 (Some drive-by housecleaning in `rustc_borrowck`)
 - rust-lang#140278 (Don't use item name to look up associated item from trait item)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust-analyzer that referenced this pull request May 28, 2025
`concat_idents!` was deprecated in [1] and will be removed in the near
future. Drop rust-analyzer's support for this macro here to avoid
problems during the next sync.

[1]: rust-lang/rust#137653
tgross35 added a commit to tgross35/rust-analyzer that referenced this pull request May 28, 2025
`concat_idents!` was deprecated in [1] and will be removed in the near
future. rust-analyzer's support is independent of rustc's, so drop RA
support now to make syncing easier.

[1]: rust-lang/rust#137653
tgross35 added a commit to tgross35/rust-analyzer that referenced this pull request May 28, 2025
`concat_idents!` was deprecated in [1] and will be removed in the near
future. rust-analyzer's support is independent of rustc's, so drop RA
support now to make syncing easier.

[1]: rust-lang/rust#137653
lnicola pushed a commit to lnicola/rust that referenced this pull request May 28, 2025
`concat_idents!` was deprecated in [1] and will be removed in the near
future. rust-analyzer's support is independent of rustc's, so drop RA
support now to make syncing easier.

[1]: rust-lang#137653
lnicola pushed a commit to lnicola/rust that referenced this pull request May 28, 2025
`concat_idents!` was deprecated in [1] and will be removed in the near
future. rust-analyzer's support is independent of rustc's, so drop RA
support now to make syncing easier.

[1]: rust-lang#137653
tgross35 added a commit to tgross35/rust that referenced this pull request Jun 19, 2025
In [rust-lang#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: rust-lang#29599

[rust-lang#137653]: rust-lang#137653
[`macro_metavar_expr_concat`]: rust-lang#124225
@tgross35
Copy link
Contributor Author

Removal PR is up at #142704

rust-bors bot added a commit that referenced this pull request Jun 19, 2025
Remove the deprecated `concat_idents!` macro

In [#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: #29599

[#137653]: #137653
[`macro_metavar_expr_concat`]: #124225
tgross35 added a commit to tgross35/rust that referenced this pull request Jun 24, 2025
In [rust-lang#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: rust-lang#29599

[rust-lang#137653]: rust-lang#137653
[`macro_metavar_expr_concat`]: rust-lang#124225
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 24, 2025
…ee1-dead

Remove the deprecated unstable `concat_idents!` macro

In [rust-lang#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: rust-lang#29599

[rust-lang#137653]: rust-lang#137653
[`macro_metavar_expr_concat`]: rust-lang#124225
rust-timer added a commit that referenced this pull request Jun 24, 2025
Rollup merge of #142704 - tgross35:remove-concat_idents, r=fee1-dead

Remove the deprecated unstable `concat_idents!` macro

In [#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: #29599

[#137653]: #137653
[`macro_metavar_expr_concat`]: #124225
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jun 26, 2025
tautschnig pushed a commit to model-checking/verify-rust-std that referenced this pull request Jul 3, 2025
…ee1-dead

Remove the deprecated unstable `concat_idents!` macro

In [rust-lang#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: rust-lang#29599

[rust-lang#137653]: rust-lang#137653
[`macro_metavar_expr_concat`]: rust-lang#124225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.