@@ -79,7 +79,7 @@ fn eval_goal(
7979 Some ( adt_or_type_alias_id)
8080 } )
8181 . unwrap ( ) ;
82- salsa :: attach ( & db, || {
82+ crate :: attach_db ( & db, || {
8383 let interner = DbInterner :: new_with ( & db, None , None ) ;
8484 let goal_ty = match adt_or_type_alias_id {
8585 Either :: Left ( adt_id) => crate :: next_solver:: Ty :: new_adt (
@@ -112,29 +112,34 @@ fn eval_expr(
112112 ) ;
113113
114114 let ( db, file_id) = TestDB :: with_single_file ( & ra_fixture) ;
115- let module_id = db. module_for_file ( file_id. file_id ( & db) ) ;
116- let def_map = module_id. def_map ( & db) ;
117- let scope = & def_map[ module_id. local_id ] . scope ;
118- let function_id = scope
119- . declarations ( )
120- . find_map ( |x| match x {
121- hir_def:: ModuleDefId :: FunctionId ( x) => {
122- let name =
123- db. function_signature ( x) . name . display_no_db ( file_id. edition ( & db) ) . to_smolstr ( ) ;
124- ( name == "main" ) . then_some ( x)
125- }
126- _ => None ,
127- } )
128- . unwrap ( ) ;
129- let hir_body = db. body ( function_id. into ( ) ) ;
130- let b = hir_body
131- . bindings ( )
132- . find ( |x| x. 1 . name . display_no_db ( file_id. edition ( & db) ) . to_smolstr ( ) == "goal" )
133- . unwrap ( )
134- . 0 ;
135- let infer = db. infer ( function_id. into ( ) ) ;
136- let goal_ty = infer. type_of_binding [ b] ;
137- salsa:: attach ( & db, || db. layout_of_ty ( goal_ty, db. trait_environment ( function_id. into ( ) ) ) )
115+ crate :: attach_db ( & db, || {
116+ let module_id = db. module_for_file ( file_id. file_id ( & db) ) ;
117+ let def_map = module_id. def_map ( & db) ;
118+ let scope = & def_map[ module_id. local_id ] . scope ;
119+ let function_id = scope
120+ . declarations ( )
121+ . find_map ( |x| match x {
122+ hir_def:: ModuleDefId :: FunctionId ( x) => {
123+ let name = db
124+ . function_signature ( x)
125+ . name
126+ . display_no_db ( file_id. edition ( & db) )
127+ . to_smolstr ( ) ;
128+ ( name == "main" ) . then_some ( x)
129+ }
130+ _ => None ,
131+ } )
132+ . unwrap ( ) ;
133+ let hir_body = db. body ( function_id. into ( ) ) ;
134+ let b = hir_body
135+ . bindings ( )
136+ . find ( |x| x. 1 . name . display_no_db ( file_id. edition ( & db) ) . to_smolstr ( ) == "goal" )
137+ . unwrap ( )
138+ . 0 ;
139+ let infer = db. infer ( function_id. into ( ) ) ;
140+ let goal_ty = infer. type_of_binding [ b] ;
141+ db. layout_of_ty ( goal_ty, db. trait_environment ( function_id. into ( ) ) )
142+ } )
138143}
139144
140145#[ track_caller]
0 commit comments