From 1e51b137d947b209a083f43cd4b0903d7ba28ce3 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 9 Jun 2021 18:42:01 +0200 Subject: Remove unnecessary duplication --- crates/hir_expand/src/builtin_attr.rs | 64 +++++------------------------------ 1 file changed, 8 insertions(+), 56 deletions(-) (limited to 'crates') diff --git a/crates/hir_expand/src/builtin_attr.rs b/crates/hir_expand/src/builtin_attr.rs index 3024410fb..c8432005e 100644 --- a/crates/hir_expand/src/builtin_attr.rs +++ b/crates/hir_expand/src/builtin_attr.rs @@ -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 { - Ok(tt.clone()) -} - -fn cfg_accessible_expand( - _db: &dyn AstDatabase, - _id: MacroCallId, - tt: &tt::Subtree, -) -> Result { - Ok(tt.clone()) -} - -fn cfg_eval_expand( - _db: &dyn AstDatabase, - _id: MacroCallId, - tt: &tt::Subtree, -) -> Result { - Ok(tt.clone()) -} - -fn derive_expand( - _db: &dyn AstDatabase, - _id: MacroCallId, - tt: &tt::Subtree, -) -> Result { - Ok(tt.clone()) -} - -fn global_allocator_expand( - _db: &dyn AstDatabase, - _id: MacroCallId, - tt: &tt::Subtree, -) -> Result { - Ok(tt.clone()) -} - -fn test_expand( - _db: &dyn AstDatabase, - _id: MacroCallId, - tt: &tt::Subtree, -) -> Result { - Ok(tt.clone()) -} - -fn test_case_expand( +fn dummy_attr_expand( _db: &dyn AstDatabase, _id: MacroCallId, tt: &tt::Subtree, -- cgit v1.2.3