about summary refs log tree commit diff
path: root/compiler/rustc_feature/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-24 15:39:38 +0200
committerGitHub <noreply@github.com>2025-06-24 15:39:38 +0200
commit0377330be4b7fa7569e4b04113207468e002d1bb (patch)
tree94b74a984795dbb1c680252f78e44905d5babea8 /compiler/rustc_feature/src
parent30550c048d0d15a91ecd678f265d331531d49f7b (diff)
parent0e4de4ceb0086b7befab6736e45ac3efbc560cea (diff)
downloadrust-0377330be4b7fa7569e4b04113207468e002d1bb.tar.gz
rust-0377330be4b7fa7569e4b04113207468e002d1bb.zip
Rollup merge of #142704 - tgross35:remove-concat_idents, r=fee1-dead
Remove the deprecated unstable `concat_idents!` macro

In [rust-lang/rust#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 513276e595f8 ("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: https://github.com/rust-lang/rust/issues/29599

[rust-lang/rust#137653]: https://github.com/rust-lang/rust/pull/137653
[`macro_metavar_expr_concat`]: https://github.com/rust-lang/rust/issues/124225
Diffstat (limited to 'compiler/rustc_feature/src')
-rw-r--r--compiler/rustc_feature/src/removed.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs
index 0cd090b25a4..c54b831e244 100644
--- a/compiler/rustc_feature/src/removed.rs
+++ b/compiler/rustc_feature/src/removed.rs
@@ -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
+    // -------------------------------------------------------------------------
 );