diff options
Diffstat (limited to 'crates/ra_hir_expand/src/builtin_derive.rs')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_derive.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs index 0b70fb9e1..87224481c 100644 --- a/crates/ra_hir_expand/src/builtin_derive.rs +++ b/crates/ra_hir_expand/src/builtin_derive.rs | |||
@@ -9,7 +9,7 @@ use ra_syntax::{ | |||
9 | }; | 9 | }; |
10 | 10 | ||
11 | use crate::db::AstDatabase; | 11 | use crate::db::AstDatabase; |
12 | use crate::{name, quote, MacroCallId, MacroDefId, MacroDefKind}; | 12 | use crate::{name, quote, LazyMacroId, MacroDefId, MacroDefKind}; |
13 | 13 | ||
14 | macro_rules! register_builtin { | 14 | macro_rules! register_builtin { |
15 | ( $($trait:ident => $expand:ident),* ) => { | 15 | ( $($trait:ident => $expand:ident),* ) => { |
@@ -22,7 +22,7 @@ macro_rules! register_builtin { | |||
22 | pub fn expand( | 22 | pub fn expand( |
23 | &self, | 23 | &self, |
24 | db: &dyn AstDatabase, | 24 | db: &dyn AstDatabase, |
25 | id: MacroCallId, | 25 | id: LazyMacroId, |
26 | tt: &tt::Subtree, | 26 | tt: &tt::Subtree, |
27 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 27 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
28 | let expander = match *self { | 28 | let expander = match *self { |
@@ -155,7 +155,7 @@ fn expand_simple_derive( | |||
155 | 155 | ||
156 | fn copy_expand( | 156 | fn copy_expand( |
157 | _db: &dyn AstDatabase, | 157 | _db: &dyn AstDatabase, |
158 | _id: MacroCallId, | 158 | _id: LazyMacroId, |
159 | tt: &tt::Subtree, | 159 | tt: &tt::Subtree, |
160 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 160 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
161 | expand_simple_derive(tt, quote! { std::marker::Copy }) | 161 | expand_simple_derive(tt, quote! { std::marker::Copy }) |
@@ -163,7 +163,7 @@ fn copy_expand( | |||
163 | 163 | ||
164 | fn clone_expand( | 164 | fn clone_expand( |
165 | _db: &dyn AstDatabase, | 165 | _db: &dyn AstDatabase, |
166 | _id: MacroCallId, | 166 | _id: LazyMacroId, |
167 | tt: &tt::Subtree, | 167 | tt: &tt::Subtree, |
168 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 168 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
169 | expand_simple_derive(tt, quote! { std::clone::Clone }) | 169 | expand_simple_derive(tt, quote! { std::clone::Clone }) |
@@ -171,7 +171,7 @@ fn clone_expand( | |||
171 | 171 | ||
172 | fn default_expand( | 172 | fn default_expand( |
173 | _db: &dyn AstDatabase, | 173 | _db: &dyn AstDatabase, |
174 | _id: MacroCallId, | 174 | _id: LazyMacroId, |
175 | tt: &tt::Subtree, | 175 | tt: &tt::Subtree, |
176 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 176 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
177 | expand_simple_derive(tt, quote! { std::default::Default }) | 177 | expand_simple_derive(tt, quote! { std::default::Default }) |
@@ -179,7 +179,7 @@ fn default_expand( | |||
179 | 179 | ||
180 | fn debug_expand( | 180 | fn debug_expand( |
181 | _db: &dyn AstDatabase, | 181 | _db: &dyn AstDatabase, |
182 | _id: MacroCallId, | 182 | _id: LazyMacroId, |
183 | tt: &tt::Subtree, | 183 | tt: &tt::Subtree, |
184 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 184 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
185 | expand_simple_derive(tt, quote! { std::fmt::Debug }) | 185 | expand_simple_derive(tt, quote! { std::fmt::Debug }) |
@@ -187,7 +187,7 @@ fn debug_expand( | |||
187 | 187 | ||
188 | fn hash_expand( | 188 | fn hash_expand( |
189 | _db: &dyn AstDatabase, | 189 | _db: &dyn AstDatabase, |
190 | _id: MacroCallId, | 190 | _id: LazyMacroId, |
191 | tt: &tt::Subtree, | 191 | tt: &tt::Subtree, |
192 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 192 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
193 | expand_simple_derive(tt, quote! { std::hash::Hash }) | 193 | expand_simple_derive(tt, quote! { std::hash::Hash }) |
@@ -195,7 +195,7 @@ fn hash_expand( | |||
195 | 195 | ||
196 | fn eq_expand( | 196 | fn eq_expand( |
197 | _db: &dyn AstDatabase, | 197 | _db: &dyn AstDatabase, |
198 | _id: MacroCallId, | 198 | _id: LazyMacroId, |
199 | tt: &tt::Subtree, | 199 | tt: &tt::Subtree, |
200 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 200 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
201 | expand_simple_derive(tt, quote! { std::cmp::Eq }) | 201 | expand_simple_derive(tt, quote! { std::cmp::Eq }) |
@@ -203,7 +203,7 @@ fn eq_expand( | |||
203 | 203 | ||
204 | fn partial_eq_expand( | 204 | fn partial_eq_expand( |
205 | _db: &dyn AstDatabase, | 205 | _db: &dyn AstDatabase, |
206 | _id: MacroCallId, | 206 | _id: LazyMacroId, |
207 | tt: &tt::Subtree, | 207 | tt: &tt::Subtree, |
208 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 208 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
209 | expand_simple_derive(tt, quote! { std::cmp::PartialEq }) | 209 | expand_simple_derive(tt, quote! { std::cmp::PartialEq }) |
@@ -211,7 +211,7 @@ fn partial_eq_expand( | |||
211 | 211 | ||
212 | fn ord_expand( | 212 | fn ord_expand( |
213 | _db: &dyn AstDatabase, | 213 | _db: &dyn AstDatabase, |
214 | _id: MacroCallId, | 214 | _id: LazyMacroId, |
215 | tt: &tt::Subtree, | 215 | tt: &tt::Subtree, |
216 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 216 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
217 | expand_simple_derive(tt, quote! { std::cmp::Ord }) | 217 | expand_simple_derive(tt, quote! { std::cmp::Ord }) |
@@ -219,7 +219,7 @@ fn ord_expand( | |||
219 | 219 | ||
220 | fn partial_ord_expand( | 220 | fn partial_ord_expand( |
221 | _db: &dyn AstDatabase, | 221 | _db: &dyn AstDatabase, |
222 | _id: MacroCallId, | 222 | _id: LazyMacroId, |
223 | tt: &tt::Subtree, | 223 | tt: &tt::Subtree, |
224 | ) -> Result<tt::Subtree, mbe::ExpandError> { | 224 | ) -> Result<tt::Subtree, mbe::ExpandError> { |
225 | expand_simple_derive(tt, quote! { std::cmp::PartialOrd }) | 225 | expand_simple_derive(tt, quote! { std::cmp::PartialOrd }) |
@@ -228,7 +228,7 @@ fn partial_ord_expand( | |||
228 | #[cfg(test)] | 228 | #[cfg(test)] |
229 | mod tests { | 229 | mod tests { |
230 | use super::*; | 230 | use super::*; |
231 | use crate::{test_db::TestDB, AstId, MacroCallKind, MacroCallLoc}; | 231 | use crate::{test_db::TestDB, AstId, MacroCallId, MacroCallKind, MacroCallLoc}; |
232 | use ra_db::{fixture::WithFixture, SourceDatabase}; | 232 | use ra_db::{fixture::WithFixture, SourceDatabase}; |
233 | 233 | ||
234 | fn expand_builtin_derive(s: &str, expander: BuiltinDeriveExpander) -> String { | 234 | fn expand_builtin_derive(s: &str, expander: BuiltinDeriveExpander) -> String { |