@@ -37,15 +37,14 @@ pub struct SubstituteTypeParams<'a> {
37
37
impl < ' a > SubstituteTypeParams < ' a > {
38
38
pub fn for_trait_impl (
39
39
source_scope : & ' a SemanticsScope < ' a , RootDatabase > ,
40
- db : & ' a RootDatabase ,
41
40
// FIXME: there's implicit invariant that `trait_` and `source_scope` match...
42
41
trait_ : hir:: Trait ,
43
42
impl_def : ast:: ImplDef ,
44
43
) -> SubstituteTypeParams < ' a > {
45
44
let substs = get_syntactic_substs ( impl_def) . unwrap_or_default ( ) ;
46
45
let generic_def: hir:: GenericDef = trait_. into ( ) ;
47
46
let substs_by_param: FxHashMap < _ , _ > = generic_def
48
- . params ( db)
47
+ . params ( source_scope . db )
49
48
. into_iter ( )
50
49
// this is a trait impl, so we need to skip the first type parameter -- this is a bit hacky
51
50
. skip ( 1 )
@@ -104,17 +103,15 @@ impl<'a> AstTransform<'a> for SubstituteTypeParams<'a> {
104
103
pub struct QualifyPaths < ' a > {
105
104
target_scope : & ' a SemanticsScope < ' a , RootDatabase > ,
106
105
source_scope : & ' a SemanticsScope < ' a , RootDatabase > ,
107
- db : & ' a RootDatabase ,
108
106
previous : Box < dyn AstTransform < ' a > + ' a > ,
109
107
}
110
108
111
109
impl < ' a > QualifyPaths < ' a > {
112
110
pub fn new (
113
111
target_scope : & ' a SemanticsScope < ' a , RootDatabase > ,
114
112
source_scope : & ' a SemanticsScope < ' a , RootDatabase > ,
115
- db : & ' a RootDatabase ,
116
113
) -> Self {
117
- Self { target_scope, source_scope, db , previous : Box :: new ( NullTransformer ) }
114
+ Self { target_scope, source_scope, previous : Box :: new ( NullTransformer ) }
118
115
}
119
116
120
117
fn get_substitution_inner (
@@ -132,7 +129,7 @@ impl<'a> QualifyPaths<'a> {
132
129
let resolution = self . source_scope . resolve_hir_path ( & hir_path?) ?;
133
130
match resolution {
134
131
PathResolution :: Def ( def) => {
135
- let found_path = from. find_use_path ( self . db , def) ?;
132
+ let found_path = from. find_use_path ( self . source_scope . db , def) ?;
136
133
let mut path = path_to_ast ( found_path) ;
137
134
138
135
let type_args = p
0 commit comments