Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/builtin/derive_macro.rs')
| -rw-r--r-- | crates/hir-expand/src/builtin/derive_macro.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/crates/hir-expand/src/builtin/derive_macro.rs b/crates/hir-expand/src/builtin/derive_macro.rs index 86ee3f153b..5e85a710e0 100644 --- a/crates/hir-expand/src/builtin/derive_macro.rs +++ b/crates/hir-expand/src/builtin/derive_macro.rs @@ -1,5 +1,6 @@ //! Builtin derives. +use base_db::SourceDatabase; use either::Either; use intern::sym; use itertools::{Itertools, izip}; @@ -13,7 +14,6 @@ use tracing::debug; use crate::{ ExpandError, ExpandResult, MacroCallId, builtin::quote::dollar_crate, - db::ExpandDatabase, hygiene::span_with_def_site_ctxt, name::{self, AsName, Name}, span_map::ExpansionSpanMap, @@ -35,7 +35,7 @@ macro_rules! register_builtin { } impl BuiltinDeriveExpander { - pub fn expander(&self) -> fn(&dyn ExpandDatabase, Span, &tt::TopSubtree) -> ExpandResult<tt::TopSubtree> { + pub fn expander(&self) -> fn(&dyn SourceDatabase, Span, &tt::TopSubtree) -> ExpandResult<tt::TopSubtree> { match *self { $( BuiltinDeriveExpander::$trait => $expand, )* } @@ -54,7 +54,7 @@ macro_rules! register_builtin { impl BuiltinDeriveExpander { pub fn expand( &self, - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, id: MacroCallId, tt: &tt::TopSubtree, span: Span, @@ -228,7 +228,7 @@ struct AdtParam { // FIXME: This whole thing needs a refactor. Each derive requires its special values, and the result is a mess. fn parse_adt( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, tt: &tt::TopSubtree, call_site: Span, ) -> Result<BasicAdtInfo, ExpandError> { @@ -387,7 +387,7 @@ fn parse_adt_from_syntax( } fn to_adt_syntax( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, tt: &tt::TopSubtree, call_site: Span, ) -> Result<(ast::Adt, span::SpanMap), ExpandError> { @@ -448,7 +448,7 @@ fn name_to_token( /// where B1, ..., BN are the bounds given by `bounds_paths`. Z is a phantom type, and /// therefore does not get bound by the derived trait. fn expand_simple_derive( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, invoc_span: Span, tt: &tt::TopSubtree, trait_path: tt::TopSubtree, @@ -531,7 +531,7 @@ fn expand_simple_derive_with_parsed( } fn copy_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -547,7 +547,7 @@ fn copy_expand( } fn clone_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -602,7 +602,7 @@ fn and_and(span: Span) -> tt::TopSubtree { } fn default_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -667,7 +667,7 @@ fn default_expand( } fn debug_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -740,7 +740,7 @@ fn debug_expand( } fn hash_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -787,7 +787,7 @@ fn hash_expand( } fn eq_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -803,7 +803,7 @@ fn eq_expand( } fn partial_eq_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -875,7 +875,7 @@ fn self_and_other_patterns( } fn ord_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -933,7 +933,7 @@ fn ord_expand( } fn partial_ord_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { @@ -996,7 +996,7 @@ fn partial_ord_expand( } fn coerce_pointee_expand( - db: &dyn ExpandDatabase, + db: &dyn SourceDatabase, span: Span, tt: &tt::TopSubtree, ) -> ExpandResult<tt::TopSubtree> { |