mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 04:23:25 +00:00
Remove unnecessary duplication
This commit is contained in:
parent
ae8d74ab2c
commit
1e51b137d9
1 changed files with 8 additions and 56 deletions
|
@ -36,13 +36,13 @@ macro_rules! register_builtin {
|
|||
}
|
||||
|
||||
register_builtin! {
|
||||
(bench, Bench) => bench_expand,
|
||||
(cfg_accessible, CfgAccessible) => cfg_accessible_expand,
|
||||
(cfg_eval, CfgEval) => cfg_eval_expand,
|
||||
(derive, Derive) => derive_expand,
|
||||
(global_allocator, GlobalAllocator) => global_allocator_expand,
|
||||
(test, Test) => test_expand,
|
||||
(test_case, TestCase) => test_case_expand
|
||||
(bench, Bench) => dummy_attr_expand,
|
||||
(cfg_accessible, CfgAccessible) => dummy_attr_expand,
|
||||
(cfg_eval, CfgEval) => dummy_attr_expand,
|
||||
(derive, Derive) => dummy_attr_expand,
|
||||
(global_allocator, GlobalAllocator) => dummy_attr_expand,
|
||||
(test, Test) => dummy_attr_expand,
|
||||
(test_case, TestCase) => dummy_attr_expand
|
||||
}
|
||||
|
||||
pub fn find_builtin_attr(
|
||||
|
@ -58,55 +58,7 @@ pub fn find_builtin_attr(
|
|||
})
|
||||
}
|
||||
|
||||
fn bench_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
Ok(tt.clone())
|
||||
}
|
||||
|
||||
fn cfg_accessible_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
Ok(tt.clone())
|
||||
}
|
||||
|
||||
fn cfg_eval_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
Ok(tt.clone())
|
||||
}
|
||||
|
||||
fn derive_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
Ok(tt.clone())
|
||||
}
|
||||
|
||||
fn global_allocator_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
Ok(tt.clone())
|
||||
}
|
||||
|
||||
fn test_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
Ok(tt.clone())
|
||||
}
|
||||
|
||||
fn test_case_expand(
|
||||
fn dummy_attr_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
|
|
Loading…
Reference in a new issue