Skip to content

Commit 7c9033e

Browse files
authored
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
2 parents 558461d + 083722c commit 7c9033e

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

core/src/macros/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,10 @@ pub(crate) mod builtin {
11381138
issue = "29599",
11391139
reason = "`concat_idents` is not stable enough for use and is subject to change"
11401140
)]
1141+
#[deprecated(
1142+
since = "1.88.0",
1143+
note = "use `${concat(...)}` with the `macro_metavar_expr_concat` feature instead"
1144+
)]
11411145
#[rustc_builtin_macro]
11421146
#[macro_export]
11431147
macro_rules! concat_idents {

core/src/prelude/v1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub use crate::hash::macros::Hash;
5959

6060
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
6161
#[allow(deprecated)]
62+
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
6263
#[doc(no_inline)]
6364
pub use crate::{
6465
assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,

std/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ pub use core::primitive;
709709
// Re-export built-in macros defined through core.
710710
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
711711
#[allow(deprecated)]
712+
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
712713
pub use core::{
713714
assert, assert_matches, cfg, column, compile_error, concat, concat_idents, const_format_args,
714715
env, file, format_args, format_args_nl, include, include_bytes, include_str, line, log_syntax,

std/src/prelude/v1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub use crate::result::Result::{self, Err, Ok};
4646
// Re-exported built-in macros
4747
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
4848
#[allow(deprecated)]
49+
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
4950
#[doc(no_inline)]
5051
pub use core::prelude::v1::{
5152
assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,

0 commit comments

Comments
 (0)