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 513276e595 ("Add #concat_idents[] and
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: https://www.github.com/rust-lang/rust/issues/29599

[137653]: https://www.github.com/rust-lang/rust/pull/137653
[`macro_metavar_expr_concat`]: https://www.github.com/rust-lang/rust/issues/124225
This commit is contained in:
Trevor Gross
2025-06-19 06:12:28 +00:00
parent c978c8986f
commit 0e4de4ceb0
21 changed files with 53 additions and 335 deletions

View File

@@ -285,4 +285,18 @@ declare_features! (
// -------------------------------------------------------------------------
// feature-group-end: removed features
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
// feature-group-start: removed library features
// -------------------------------------------------------------------------
//
// FIXME(#141617): we should have a better way to track removed library features, but we reuse
// the infrastructure here so users still get hints. The symbols used here can be remove from
// `symbol.rs` when that happens.
(removed, concat_idents, "CURRENT_RUSTC_VERSION", Some(29599),
Some("use the `${concat(..)}` metavariable expression instead"), 142704),
// -------------------------------------------------------------------------
// feature-group-end: removed library features
// -------------------------------------------------------------------------
);