about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-06-19 06:12:28 +0000
committerTrevor Gross <tmgross@umich.edu>2025-06-24 11:07:16 +0000
commit0e4de4ceb0086b7befab6736e45ac3efbc560cea (patch)
treec8a821b0095be52479016b0827422d6462048a03 /src
parentc978c8986f700bc8fa83b5f98cc96f41772fa281 (diff)
downloadrust-0e4de4ceb0086b7befab6736e45ac3efbc560cea.tar.gz
rust-0e4de4ceb0086b7befab6736e45ac3efbc560cea.zip
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 513276e595f8 ("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
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/language-features/macro-metavar-expr-concat.md6
-rw-r--r--src/doc/unstable-book/src/library-features/concat-idents.md27
2 files changed, 3 insertions, 30 deletions
diff --git a/src/doc/unstable-book/src/language-features/macro-metavar-expr-concat.md b/src/doc/unstable-book/src/language-features/macro-metavar-expr-concat.md
index b6dbdb14407..7eb5dca532f 100644
--- a/src/doc/unstable-book/src/language-features/macro-metavar-expr-concat.md
+++ b/src/doc/unstable-book/src/language-features/macro-metavar-expr-concat.md
@@ -8,7 +8,8 @@ In stable Rust, there is no way to create new identifiers by joining identifiers
  `#![feature(macro_metavar_expr_concat)]` introduces a way to do this, using the concat metavariable expression.
 
 > This feature uses the syntax from [`macro_metavar_expr`] but is otherwise
-> independent. It replaces the old unstable feature [`concat_idents`].
+> independent. It replaces the since-removed unstable feature
+> [`concat_idents`].
 
 > This is an experimental feature; it and its syntax will require a RFC before stabilization.
 
@@ -126,8 +127,7 @@ test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
 
 [`paste`]: https://crates.io/crates/paste
 [RFC 3086]: https://rust-lang.github.io/rfcs/3086-macro-metavar-expr.html
-[`concat_idents!`]: https://doc.rust-lang.org/nightly/std/macro.concat_idents.html
 [`macro_metavar_expr`]: ../language-features/macro-metavar-expr.md
-[`concat_idents`]: ../library-features/concat-idents.md
+[`concat_idents`]: https://github.com/rust-lang/rust/issues/29599
 [#124225]: https://github.com/rust-lang/rust/issues/124225
 [declarative macros]: https://doc.rust-lang.org/stable/reference/macros-by-example.html
diff --git a/src/doc/unstable-book/src/library-features/concat-idents.md b/src/doc/unstable-book/src/library-features/concat-idents.md
deleted file mode 100644
index 8a38d155e3d..00000000000
--- a/src/doc/unstable-book/src/library-features/concat-idents.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# `concat_idents`
-
-The tracking issue for this feature is: [#29599]
-
-This feature is deprecated, to be replaced by [`macro_metavar_expr_concat`].
-
-[#29599]: https://github.com/rust-lang/rust/issues/29599
-[`macro_metavar_expr_concat`]: https://github.com/rust-lang/rust/issues/124225
-
-------------------------
-
-> This feature is expected to be superseded by [`macro_metavar_expr_concat`](../language-features/macro-metavar-expr-concat.md).
-
-The `concat_idents` feature adds a macro for concatenating multiple identifiers
-into one identifier.
-
-## Examples
-
-```rust
-#![feature(concat_idents)]
-
-fn main() {
-    fn foobar() -> u32 { 23 }
-    let f = concat_idents!(foo, bar);
-    assert_eq!(f(), 23);
-}
-```