Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 79ebf61

Browse files
committed
Simplify
1 parent 86b968b commit 79ebf61

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

crates/hir_def/src/macro_expansion_tests.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -345,23 +345,7 @@ impl base_db::ProcMacroExpander for IdentityWhenValidProcMacroExpander {
345345
if parse.errors().is_empty() {
346346
Ok(subtree.clone())
347347
} else {
348-
eprintln!("parse errors: {:?}", parse.errors());
349-
use tt::{Delimiter, DelimiterKind, Ident, Leaf, Literal, Punct, TokenTree};
350-
let mut subtree = Subtree::default();
351-
subtree.token_trees.push(TokenTree::Leaf(
352-
Ident { text: "compile_error!".into(), id: TokenId(0) }.into(),
353-
));
354-
subtree.token_trees.push(TokenTree::Subtree(Subtree {
355-
delimiter: Some(Delimiter { id: TokenId(2), kind: DelimiterKind::Parenthesis }),
356-
token_trees: vec![TokenTree::Leaf(Leaf::Literal(Literal {
357-
text: r#""parse error""#.into(),
358-
id: TokenId::unspecified(),
359-
}))],
360-
}));
361-
subtree.token_trees.push(TokenTree::Leaf(
362-
Punct { char: ';', spacing: tt::Spacing::Alone, id: TokenId::unspecified() }.into(),
363-
));
364-
Ok(subtree)
348+
panic!("got invalid macro input: {:?}", parse.errors());
365349
}
366350
}
367351
}

0 commit comments

Comments
 (0)