aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-09 17:42:01 +0100
committerLukas Wirth <[email protected]>2021-06-09 17:42:01 +0100
commit1e51b137d947b209a083f43cd4b0903d7ba28ce3 (patch)
tree482b3232ebab974ca73616fef50bfc531f44b53f /crates
parentae8d74ab2caed66dc84f64f6859bdf3f131388e1 (diff)
Remove unnecessary duplication
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_expand/src/builtin_attr.rs64
1 files changed, 8 insertions, 56 deletions
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 {
36} 36}
37 37
38register_builtin! { 38register_builtin! {
39 (bench, Bench) => bench_expand, 39 (bench, Bench) => dummy_attr_expand,
40 (cfg_accessible, CfgAccessible) => cfg_accessible_expand, 40 (cfg_accessible, CfgAccessible) => dummy_attr_expand,
41 (cfg_eval, CfgEval) => cfg_eval_expand, 41 (cfg_eval, CfgEval) => dummy_attr_expand,
42 (derive, Derive) => derive_expand, 42 (derive, Derive) => dummy_attr_expand,
43 (global_allocator, GlobalAllocator) => global_allocator_expand, 43 (global_allocator, GlobalAllocator) => dummy_attr_expand,
44 (test, Test) => test_expand, 44 (test, Test) => dummy_attr_expand,
45 (test_case, TestCase) => test_case_expand 45 (test_case, TestCase) => dummy_attr_expand
46} 46}
47 47
48pub fn find_builtin_attr( 48pub fn find_builtin_attr(
@@ -58,55 +58,7 @@ pub fn find_builtin_attr(
58 }) 58 })
59} 59}
60 60
61fn bench_expand( 61fn dummy_attr_expand(
62 _db: &dyn AstDatabase,
63 _id: MacroCallId,
64 tt: &tt::Subtree,
65) -> Result<tt::Subtree, mbe::ExpandError> {
66 Ok(tt.clone())
67}
68
69fn cfg_accessible_expand(
70 _db: &dyn AstDatabase,
71 _id: MacroCallId,
72 tt: &tt::Subtree,
73) -> Result<tt::Subtree, mbe::ExpandError> {
74 Ok(tt.clone())
75}
76
77fn cfg_eval_expand(
78 _db: &dyn AstDatabase,
79 _id: MacroCallId,
80 tt: &tt::Subtree,
81) -> Result<tt::Subtree, mbe::ExpandError> {
82 Ok(tt.clone())
83}
84
85fn derive_expand(
86 _db: &dyn AstDatabase,
87 _id: MacroCallId,
88 tt: &tt::Subtree,
89) -> Result<tt::Subtree, mbe::ExpandError> {
90 Ok(tt.clone())
91}
92
93fn global_allocator_expand(
94 _db: &dyn AstDatabase,
95 _id: MacroCallId,
96 tt: &tt::Subtree,
97) -> Result<tt::Subtree, mbe::ExpandError> {
98 Ok(tt.clone())
99}
100
101fn test_expand(
102 _db: &dyn AstDatabase,
103 _id: MacroCallId,
104 tt: &tt::Subtree,
105) -> Result<tt::Subtree, mbe::ExpandError> {
106 Ok(tt.clone())
107}
108
109fn test_case_expand(
110 _db: &dyn AstDatabase, 62 _db: &dyn AstDatabase,
111 _id: MacroCallId, 63 _id: MacroCallId,
112 tt: &tt::Subtree, 64 tt: &tt::Subtree,