@@ -29,6 +29,8 @@ pub mod resolver;
2929mod trace;
3030pub mod nameres;
3131
32+ pub mod src;
33+
3234#[ cfg( test) ]
3335mod test_db;
3436#[ cfg( test) ]
@@ -37,7 +39,7 @@ mod marks;
3739use std:: hash:: { Hash , Hasher } ;
3840
3941use hir_expand:: { ast_id_map:: FileAstId , db:: AstDatabase , AstId , HirFileId , InFile , MacroDefId } ;
40- use ra_arena:: { impl_arena_id, map :: ArenaMap , RawId } ;
42+ use ra_arena:: { impl_arena_id, RawId } ;
4143use ra_db:: { impl_intern_key, salsa, CrateId } ;
4244use ra_syntax:: { ast, AstNode } ;
4345
@@ -514,53 +516,3 @@ impl HasModule for StaticLoc {
514516 self . container
515517 }
516518}
517-
518- pub trait HasSource {
519- type Value ;
520- fn source ( & self , db : & impl db:: DefDatabase ) -> InFile < Self :: Value > ;
521- }
522-
523- impl HasSource for FunctionLoc {
524- type Value = ast:: FnDef ;
525-
526- fn source ( & self , db : & impl db:: DefDatabase ) -> InFile < ast:: FnDef > {
527- let node = self . ast_id . to_node ( db) ;
528- InFile :: new ( self . ast_id . file_id , node)
529- }
530- }
531-
532- impl HasSource for TypeAliasLoc {
533- type Value = ast:: TypeAliasDef ;
534-
535- fn source ( & self , db : & impl db:: DefDatabase ) -> InFile < ast:: TypeAliasDef > {
536- let node = self . ast_id . to_node ( db) ;
537- InFile :: new ( self . ast_id . file_id , node)
538- }
539- }
540-
541- impl HasSource for ConstLoc {
542- type Value = ast:: ConstDef ;
543-
544- fn source ( & self , db : & impl db:: DefDatabase ) -> InFile < ast:: ConstDef > {
545- let node = self . ast_id . to_node ( db) ;
546- InFile :: new ( self . ast_id . file_id , node)
547- }
548- }
549-
550- impl HasSource for StaticLoc {
551- type Value = ast:: StaticDef ;
552-
553- fn source ( & self , db : & impl db:: DefDatabase ) -> InFile < ast:: StaticDef > {
554- let node = self . ast_id . to_node ( db) ;
555- InFile :: new ( self . ast_id . file_id , node)
556- }
557- }
558-
559- pub trait HasChildSource {
560- type ChildId ;
561- type Value ;
562- fn child_source (
563- & self ,
564- db : & impl db:: DefDatabase ,
565- ) -> InFile < ArenaMap < Self :: ChildId , Self :: Value > > ;
566- }
0 commit comments