Skip to content

Commit 1e51b13

Browse files
committed
Remove unnecessary duplication
1 parent ae8d74a commit 1e51b13

File tree

1 file changed

+8
-56
lines changed

1 file changed

+8
-56
lines changed

crates/hir_expand/src/builtin_attr.rs

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ macro_rules! register_builtin {
3636
}
3737

3838
register_builtin! {
39-
(bench, Bench) => bench_expand,
40-
(cfg_accessible, CfgAccessible) => cfg_accessible_expand,
41-
(cfg_eval, CfgEval) => cfg_eval_expand,
42-
(derive, Derive) => derive_expand,
43-
(global_allocator, GlobalAllocator) => global_allocator_expand,
44-
(test, Test) => test_expand,
45-
(test_case, TestCase) => test_case_expand
39+
(bench, Bench) => dummy_attr_expand,
40+
(cfg_accessible, CfgAccessible) => dummy_attr_expand,
41+
(cfg_eval, CfgEval) => dummy_attr_expand,
42+
(derive, Derive) => dummy_attr_expand,
43+
(global_allocator, GlobalAllocator) => dummy_attr_expand,
44+
(test, Test) => dummy_attr_expand,
45+
(test_case, TestCase) => dummy_attr_expand
4646
}
4747

4848
pub fn find_builtin_attr(
@@ -58,55 +58,7 @@ pub fn find_builtin_attr(
5858
})
5959
}
6060

61-
fn bench_expand(
62-
_db: &dyn AstDatabase,
63-
_id: MacroCallId,
64-
tt: &tt::Subtree,
65-
) -> Result<tt::Subtree, mbe::ExpandError> {
66-
Ok(tt.clone())
67-
}
68-
69-
fn 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-
77-
fn 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-
85-
fn 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-
93-
fn 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-
101-
fn 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-
109-
fn test_case_expand(
61+
fn dummy_attr_expand(
11062
_db: &dyn AstDatabase,
11163
_id: MacroCallId,
11264
tt: &tt::Subtree,

0 commit comments

Comments
 (0)