@@ -79,7 +79,7 @@ fn eval_goal(
79
79
Some ( adt_or_type_alias_id)
80
80
} )
81
81
. unwrap ( ) ;
82
- salsa :: attach ( & db, || {
82
+ crate :: attach_db ( & db, || {
83
83
let interner = DbInterner :: new_with ( & db, None , None ) ;
84
84
let goal_ty = match adt_or_type_alias_id {
85
85
Either :: Left ( adt_id) => crate :: next_solver:: Ty :: new_adt (
@@ -112,29 +112,34 @@ fn eval_expr(
112
112
) ;
113
113
114
114
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
+ } )
138
143
}
139
144
140
145
#[ track_caller]
0 commit comments