@@ -297,19 +297,19 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
297297 self . with_ctx ( |ctx| ctx. file_to_def ( file) ) . map ( Module :: from)
298298 }
299299
300- pub fn scope ( & self , node : & SyntaxNode ) -> SemanticsScope < ' db , DB > {
300+ pub fn scope ( & self , node : & SyntaxNode ) -> SemanticsScope < ' db > {
301301 let node = self . find_file ( node. clone ( ) ) ;
302302 let resolver = self . analyze2 ( node. as_ref ( ) , None ) . resolver ;
303303 SemanticsScope { db : self . db , resolver }
304304 }
305305
306- pub fn scope_at_offset ( & self , node : & SyntaxNode , offset : TextSize ) -> SemanticsScope < ' db , DB > {
306+ pub fn scope_at_offset ( & self , node : & SyntaxNode , offset : TextSize ) -> SemanticsScope < ' db > {
307307 let node = self . find_file ( node. clone ( ) ) ;
308308 let resolver = self . analyze2 ( node. as_ref ( ) , Some ( offset) ) . resolver ;
309309 SemanticsScope { db : self . db , resolver }
310310 }
311311
312- pub fn scope_for_def ( & self , def : Trait ) -> SemanticsScope < ' db , DB > {
312+ pub fn scope_for_def ( & self , def : Trait ) -> SemanticsScope < ' db > {
313313 let resolver = def. id . resolver ( self . db ) ;
314314 SemanticsScope { db : self . db , resolver }
315315 }
@@ -419,12 +419,12 @@ fn find_root(node: &SyntaxNode) -> SyntaxNode {
419419 node. ancestors ( ) . last ( ) . unwrap ( )
420420}
421421
422- pub struct SemanticsScope < ' a , DB > {
423- pub db : & ' a DB ,
422+ pub struct SemanticsScope < ' a > {
423+ pub db : & ' a dyn HirDatabase ,
424424 resolver : Resolver ,
425425}
426426
427- impl < ' a , DB : HirDatabase > SemanticsScope < ' a , DB > {
427+ impl < ' a > SemanticsScope < ' a > {
428428 pub fn module ( & self ) -> Option < Module > {
429429 Some ( Module { id : self . resolver . module ( ) ? } )
430430 }
@@ -433,13 +433,13 @@ impl<'a, DB: HirDatabase> SemanticsScope<'a, DB> {
433433 // FIXME: rename to visible_traits to not repeat scope?
434434 pub fn traits_in_scope ( & self ) -> FxHashSet < TraitId > {
435435 let resolver = & self . resolver ;
436- resolver. traits_in_scope ( self . db )
436+ resolver. traits_in_scope ( self . db . upcast ( ) )
437437 }
438438
439439 pub fn process_all_names ( & self , f : & mut dyn FnMut ( Name , ScopeDef ) ) {
440440 let resolver = & self . resolver ;
441441
442- resolver. process_all_names ( self . db , & mut |name, def| {
442+ resolver. process_all_names ( self . db . upcast ( ) , & mut |name, def| {
443443 let def = match def {
444444 resolver:: ScopeDef :: PerNs ( it) => {
445445 let items = ScopeDef :: all_items ( it) ;
0 commit comments