Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #19877 from tgross35/remove-concat-idents
chore: Remove support for `concat_idents!`
Lukas Wirth 11 months ago
parent 4f7af13 · parent e6e5e3c · commit 93182f4
-rw-r--r--crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs18
-rw-r--r--crates/hir-expand/src/builtin/fn_macro.rs25
-rw-r--r--crates/intern/src/symbol/symbols.rs1
3 files changed, 0 insertions, 44 deletions
diff --git a/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs b/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs
index 3027aff316..293868df61 100644
--- a/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs
+++ b/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs
@@ -510,24 +510,6 @@ fn main() { "s"; }
}
#[test]
-fn test_concat_idents_expand() {
- check(
- r##"
-#[rustc_builtin_macro]
-macro_rules! concat_idents {}
-
-fn main() { concat_idents!(foo, bar); }
-"##,
- expect![[r##"
-#[rustc_builtin_macro]
-macro_rules! concat_idents {}
-
-fn main() { foobar; }
-"##]],
- );
-}
-
-#[test]
fn test_quote_string() {
check(
r##"
diff --git a/crates/hir-expand/src/builtin/fn_macro.rs b/crates/hir-expand/src/builtin/fn_macro.rs
index 539c727728..3180b8dae1 100644
--- a/crates/hir-expand/src/builtin/fn_macro.rs
+++ b/crates/hir-expand/src/builtin/fn_macro.rs
@@ -140,7 +140,6 @@ register_builtin! {
EagerExpander:
(compile_error, CompileError) => compile_error_expand,
(concat, Concat) => concat_expand,
- (concat_idents, ConcatIdents) => concat_idents_expand,
(concat_bytes, ConcatBytes) => concat_bytes_expand,
(include, Include) => include_expand,
(include_bytes, IncludeBytes) => include_bytes_expand,
@@ -660,30 +659,6 @@ fn concat_bytes_expand_subtree(
Ok(())
}
-fn concat_idents_expand(
- _db: &dyn ExpandDatabase,
- _arg_id: MacroCallId,
- tt: &tt::TopSubtree,
- span: Span,
-) -> ExpandResult<tt::TopSubtree> {
- let mut err = None;
- let mut ident = String::new();
- for (i, t) in tt.iter().enumerate() {
- match t {
- TtElement::Leaf(tt::Leaf::Ident(id)) => {
- ident.push_str(id.sym.as_str());
- }
- TtElement::Leaf(tt::Leaf::Punct(punct)) if i % 2 == 1 && punct.char == ',' => (),
- _ => {
- err.get_or_insert(ExpandError::other(span, "unexpected token"));
- }
- }
- }
- // FIXME merge spans
- let ident = tt::Ident { sym: Symbol::intern(&ident), span, is_raw: tt::IdentIsRaw::No };
- ExpandResult { value: quote!(span =>#ident), err }
-}
-
fn relative_file(
db: &dyn ExpandDatabase,
call_id: MacroCallId,
diff --git a/crates/intern/src/symbol/symbols.rs b/crates/intern/src/symbol/symbols.rs
index abde48d151..fc922dd849 100644
--- a/crates/intern/src/symbol/symbols.rs
+++ b/crates/intern/src/symbol/symbols.rs
@@ -164,7 +164,6 @@ define_symbols! {
completion,
compile_error,
concat_bytes,
- concat_idents,
concat,
const_format_args,
const_panic_fmt,