Skip to content

Commit c4e45d1

Browse files
committed
fixup! Remove the deprecated concat_idents! macro
1 parent ef013ec commit c4e45d1

File tree

6 files changed

+34
-6
lines changed

6 files changed

+34
-6
lines changed

compiler/rustc_feature/src/removed.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,18 @@ declare_features! (
285285
// -------------------------------------------------------------------------
286286
// feature-group-end: removed features
287287
// -------------------------------------------------------------------------
288+
289+
290+
// -------------------------------------------------------------------------
291+
// feature-group-start: removed library features
292+
// -------------------------------------------------------------------------
293+
//
294+
// FIXME(#141617): we should have a better way to track removed library features, but we reuse
295+
// the infrastructure here so users still get hints. The symbols used here can be remove from
296+
// `symbol.rs` when that happens.
297+
(removed, concat_idents, "CURRENT_RUSTC_VERSION", Some(29599),
298+
Some("use the `${concat(..)}` metavariable expression instead"), 142704),
299+
// -------------------------------------------------------------------------
300+
// feature-group-end: removed library features
301+
// -------------------------------------------------------------------------
288302
);

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ symbols! {
684684
compiler_fence,
685685
concat,
686686
concat_bytes,
687+
concat_idents,
687688
conservative_impl_trait,
688689
console,
689690
const_allocate,

library/core/src/prelude/v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub use crate::hash::macros::Hash;
6060
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
6161
#[doc(no_inline)]
6262
pub use crate::{
63-
assert, cfg, column, compile_error, concat, env, file, format_args,
63+
assert, cfg, column, compile_error, concat, env, file, format_args,
6464
format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
6565
stringify, trace_macros,
6666
};

tests/ui/unpretty/exhaustive.expanded.stdout

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,12 @@ mod types {
620620
/*! there is no syntax for this */
621621
}
622622
/// TyKind::MacCall
623-
fn ty_mac_call() { let _ = "T"; let _ = "T"; let _ = "T"; }
623+
fn ty_mac_call() {
624+
macro_rules! ty { ($ty:ty) => { $ty } }
625+
let _: T;
626+
let _: T;
627+
let _: T;
628+
}
624629
/// TyKind::CVarArgs
625630
fn ty_c_var_args() {
626631
/*! FIXME: todo */

tests/ui/unpretty/exhaustive.hir.stdout

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,12 @@ mod types {
694694
/*! there is no syntax for this */
695695
fn ty_implicit_self() { }
696696
/// TyKind::MacCall
697-
fn ty_mac_call() { let _ = "T"; let _ = "T"; let _ = "T"; }
697+
fn ty_mac_call() {
698+
macro_rules! ty { ($ty:ty) => { $ty } }
699+
let _: T;
700+
let _: T;
701+
let _: T;
702+
}
698703
/// TyKind::CVarArgs
699704
/*! FIXME: todo */
700705
fn ty_c_var_args() { }

tests/ui/unpretty/exhaustive.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,12 @@ mod types {
835835

836836
/// TyKind::MacCall
837837
fn ty_mac_call() {
838-
let _ = concat!("T");
839-
let _ = concat!["T"];
840-
let _ = concat! { "T" };
838+
macro_rules! ty {
839+
($ty:ty) => { $ty }
840+
}
841+
let _: ty!(T);
842+
let _: ty![T];
843+
let _: ty! { T };
841844
}
842845

843846
/// TyKind::CVarArgs

0 commit comments

Comments
 (0)