Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,24 +509,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(
Expand Down
25 changes: 0 additions & 25 deletions crates/hir-expand/src/builtin/fn_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion crates/intern/src/symbol/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ define_symbols! {
completion,
compile_error,
concat_bytes,
concat_idents,
concat,
const_format_args,
const_panic_fmt,
Expand Down