@@ -134,6 +134,7 @@ pub trait SolverDelegateEvalExt: SolverDelegate {
134
134
& self ,
135
135
goal : Goal < Self :: Interner , <Self :: Interner as Interner >:: Predicate > ,
136
136
generate_proof_tree : GenerateProofTree ,
137
+ span : <Self :: Interner as Interner >:: Span ,
137
138
) -> (
138
139
Result < ( HasChanged , Certainty ) , NoSolution > ,
139
140
Option < inspect:: GoalEvaluation < Self :: Interner > > ,
@@ -174,9 +175,10 @@ where
174
175
& self ,
175
176
goal : Goal < I , I :: Predicate > ,
176
177
generate_proof_tree : GenerateProofTree ,
178
+ span : I :: Span ,
177
179
) -> ( Result < ( HasChanged , Certainty ) , NoSolution > , Option < inspect:: GoalEvaluation < I > > ) {
178
180
EvalCtxt :: enter_root ( self , self . cx ( ) . recursion_limit ( ) , generate_proof_tree, |ecx| {
179
- ecx. evaluate_goal ( GoalEvaluationKind :: Root , GoalSource :: Misc , goal)
181
+ ecx. evaluate_goal ( GoalEvaluationKind :: Root , GoalSource :: Misc , goal, span )
180
182
} )
181
183
}
182
184
@@ -187,7 +189,12 @@ where
187
189
) -> bool {
188
190
self . probe ( || {
189
191
EvalCtxt :: enter_root ( self , root_depth, GenerateProofTree :: No , |ecx| {
190
- ecx. evaluate_goal ( GoalEvaluationKind :: Root , GoalSource :: Misc , goal)
192
+ ecx. evaluate_goal (
193
+ GoalEvaluationKind :: Root ,
194
+ GoalSource :: Misc ,
195
+ goal,
196
+ I :: Span :: dummy ( ) ,
197
+ )
191
198
} )
192
199
. 0
193
200
} )
@@ -204,7 +211,12 @@ where
204
211
Option < inspect:: GoalEvaluation < I > > ,
205
212
) {
206
213
EvalCtxt :: enter_root ( self , self . cx ( ) . recursion_limit ( ) , generate_proof_tree, |ecx| {
207
- ecx. evaluate_goal_raw ( GoalEvaluationKind :: Root , GoalSource :: Misc , goal)
214
+ ecx. evaluate_goal_raw (
215
+ GoalEvaluationKind :: Root ,
216
+ GoalSource :: Misc ,
217
+ goal,
218
+ I :: Span :: dummy ( ) ,
219
+ )
208
220
} )
209
221
}
210
222
}
@@ -294,7 +306,7 @@ where
294
306
} ;
295
307
296
308
for & ( key, ty) in & input. predefined_opaques_in_body . opaque_types {
297
- ecx. delegate . inject_new_hidden_type_unchecked ( key, ty) ;
309
+ ecx. delegate . inject_new_hidden_type_unchecked ( key, ty, I :: Span :: dummy ( ) ) ;
298
310
}
299
311
300
312
if !ecx. nested_goals . is_empty ( ) {
@@ -370,9 +382,10 @@ where
370
382
goal_evaluation_kind : GoalEvaluationKind ,
371
383
source : GoalSource ,
372
384
goal : Goal < I , I :: Predicate > ,
385
+ span : I :: Span ,
373
386
) -> Result < ( HasChanged , Certainty ) , NoSolution > {
374
387
let ( normalization_nested_goals, has_changed, certainty) =
375
- self . evaluate_goal_raw ( goal_evaluation_kind, source, goal) ?;
388
+ self . evaluate_goal_raw ( goal_evaluation_kind, source, goal, span ) ?;
376
389
assert ! ( normalization_nested_goals. is_empty( ) ) ;
377
390
Ok ( ( has_changed, certainty) )
378
391
}
@@ -391,6 +404,7 @@ where
391
404
goal_evaluation_kind : GoalEvaluationKind ,
392
405
_source : GoalSource ,
393
406
goal : Goal < I , I :: Predicate > ,
407
+ span : I :: Span ,
394
408
) -> Result < ( NestedNormalizationGoals < I > , HasChanged , Certainty ) , NoSolution > {
395
409
let ( orig_values, canonical_goal) = self . canonicalize_goal ( goal) ;
396
410
let mut goal_evaluation =
@@ -418,7 +432,7 @@ where
418
432
} ;
419
433
420
434
let ( normalization_nested_goals, certainty) =
421
- self . instantiate_and_apply_query_response ( goal. param_env , orig_values, response) ;
435
+ self . instantiate_and_apply_query_response ( goal. param_env , orig_values, response, span ) ;
422
436
self . inspect . goal_evaluation ( goal_evaluation) ;
423
437
424
438
// FIXME: We previously had an assert here that checked that recomputing
@@ -546,6 +560,7 @@ where
546
560
GoalEvaluationKind :: Nested ,
547
561
GoalSource :: Misc ,
548
562
unconstrained_goal,
563
+ I :: Span :: dummy ( ) ,
549
564
) ?;
550
565
// Add the nested goals from normalization to our own nested goals.
551
566
trace ! ( ?nested_goals) ;
@@ -591,7 +606,7 @@ where
591
606
592
607
for ( source, goal) in goals. goals {
593
608
let ( has_changed, certainty) =
594
- self . evaluate_goal ( GoalEvaluationKind :: Nested , source, goal) ?;
609
+ self . evaluate_goal ( GoalEvaluationKind :: Nested , source, goal, I :: Span :: dummy ( ) ) ?;
595
610
if has_changed == HasChanged :: Yes {
596
611
unchanged_certainty = None ;
597
612
}
@@ -822,8 +837,12 @@ where
822
837
let identity_args = self . fresh_args_for_item ( alias. def_id ) ;
823
838
let rigid_ctor = ty:: AliasTerm :: new_from_args ( cx, alias. def_id , identity_args) ;
824
839
let ctor_term = rigid_ctor. to_term ( cx) ;
825
- let obligations =
826
- self . delegate . eq_structurally_relating_aliases ( param_env, term, ctor_term) ?;
840
+ let obligations = self . delegate . eq_structurally_relating_aliases (
841
+ param_env,
842
+ term,
843
+ ctor_term,
844
+ I :: Span :: dummy ( ) ,
845
+ ) ?;
827
846
debug_assert ! ( obligations. is_empty( ) ) ;
828
847
self . relate ( param_env, alias, variance, rigid_ctor)
829
848
} else {
@@ -841,7 +860,12 @@ where
841
860
lhs : T ,
842
861
rhs : T ,
843
862
) -> Result < ( ) , NoSolution > {
844
- let result = self . delegate . eq_structurally_relating_aliases ( param_env, lhs, rhs) ?;
863
+ let result = self . delegate . eq_structurally_relating_aliases (
864
+ param_env,
865
+ lhs,
866
+ rhs,
867
+ I :: Span :: dummy ( ) ,
868
+ ) ?;
845
869
assert_eq ! ( result, vec![ ] ) ;
846
870
Ok ( ( ) )
847
871
}
@@ -864,7 +888,7 @@ where
864
888
variance : ty:: Variance ,
865
889
rhs : T ,
866
890
) -> Result < ( ) , NoSolution > {
867
- let goals = self . delegate . relate ( param_env, lhs, variance, rhs) ?;
891
+ let goals = self . delegate . relate ( param_env, lhs, variance, rhs, I :: Span :: dummy ( ) ) ?;
868
892
self . add_goals ( GoalSource :: Misc , goals) ;
869
893
Ok ( ( ) )
870
894
}
@@ -881,7 +905,7 @@ where
881
905
lhs : T ,
882
906
rhs : T ,
883
907
) -> Result < Vec < Goal < I , I :: Predicate > > , NoSolution > {
884
- Ok ( self . delegate . relate ( param_env, lhs, ty:: Variance :: Invariant , rhs) ?)
908
+ Ok ( self . delegate . relate ( param_env, lhs, ty:: Variance :: Invariant , rhs, I :: Span :: dummy ( ) ) ?)
885
909
}
886
910
887
911
pub ( super ) fn instantiate_binder_with_infer < T : TypeFoldable < I > + Copy > (
@@ -917,12 +941,12 @@ where
917
941
}
918
942
919
943
pub ( super ) fn register_ty_outlives ( & self , ty : I :: Ty , lt : I :: Region ) {
920
- self . delegate . register_ty_outlives ( ty, lt) ;
944
+ self . delegate . register_ty_outlives ( ty, lt, I :: Span :: dummy ( ) ) ;
921
945
}
922
946
923
947
pub ( super ) fn register_region_outlives ( & self , a : I :: Region , b : I :: Region ) {
924
948
// `b : a` ==> `a <= b`
925
- self . delegate . sub_regions ( b, a) ;
949
+ self . delegate . sub_regions ( b, a, I :: Span :: dummy ( ) ) ;
926
950
}
927
951
928
952
/// Computes the list of goals required for `arg` to be well-formed
0 commit comments