Skip to content

Commit c92289d

Browse files
committed
chore: Remove support for concat_idents!
`concat_idents!` was deprecated in [1] and will be removed in the near future. rust-analyzer's support is independent of rustc's, so drop RA support now to make syncing easier. [1]: rust-lang#137653
1 parent f6fb63e commit c92289d

File tree

3 files changed

+0
-44
lines changed

3 files changed

+0
-44
lines changed

src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -509,24 +509,6 @@ fn main() { "s"; }
509509
);
510510
}
511511

512-
#[test]
513-
fn test_concat_idents_expand() {
514-
check(
515-
r##"
516-
#[rustc_builtin_macro]
517-
macro_rules! concat_idents {}
518-
519-
fn main() { concat_idents!(foo, bar); }
520-
"##,
521-
expect![[r##"
522-
#[rustc_builtin_macro]
523-
macro_rules! concat_idents {}
524-
525-
fn main() { foobar; }
526-
"##]],
527-
);
528-
}
529-
530512
#[test]
531513
fn test_quote_string() {
532514
check(

src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ register_builtin! {
140140
EagerExpander:
141141
(compile_error, CompileError) => compile_error_expand,
142142
(concat, Concat) => concat_expand,
143-
(concat_idents, ConcatIdents) => concat_idents_expand,
144143
(concat_bytes, ConcatBytes) => concat_bytes_expand,
145144
(include, Include) => include_expand,
146145
(include_bytes, IncludeBytes) => include_bytes_expand,
@@ -660,30 +659,6 @@ fn concat_bytes_expand_subtree(
660659
Ok(())
661660
}
662661

663-
fn concat_idents_expand(
664-
_db: &dyn ExpandDatabase,
665-
_arg_id: MacroCallId,
666-
tt: &tt::TopSubtree,
667-
span: Span,
668-
) -> ExpandResult<tt::TopSubtree> {
669-
let mut err = None;
670-
let mut ident = String::new();
671-
for (i, t) in tt.iter().enumerate() {
672-
match t {
673-
TtElement::Leaf(tt::Leaf::Ident(id)) => {
674-
ident.push_str(id.sym.as_str());
675-
}
676-
TtElement::Leaf(tt::Leaf::Punct(punct)) if i % 2 == 1 && punct.char == ',' => (),
677-
_ => {
678-
err.get_or_insert(ExpandError::other(span, "unexpected token"));
679-
}
680-
}
681-
}
682-
// FIXME merge spans
683-
let ident = tt::Ident { sym: Symbol::intern(&ident), span, is_raw: tt::IdentIsRaw::No };
684-
ExpandResult { value: quote!(span =>#ident), err }
685-
}
686-
687662
fn relative_file(
688663
db: &dyn ExpandDatabase,
689664
call_id: MacroCallId,

src/tools/rust-analyzer/crates/intern/src/symbol/symbols.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ define_symbols! {
164164
completion,
165165
compile_error,
166166
concat_bytes,
167-
concat_idents,
168167
concat,
169168
const_format_args,
170169
const_panic_fmt,

0 commit comments

Comments
 (0)