File tree 1 file changed +3
-7
lines changed
compiler/rustc_middle/src/ty
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -505,13 +505,9 @@ pub fn structurally_relate_tys<'tcx, R: TypeRelation<'tcx>>(
505
505
Err ( err) => {
506
506
// Check whether the lengths are both concrete/known values,
507
507
// but are unequal, for better diagnostics.
508
- //
509
- // It might seem dubious to eagerly evaluate these constants here,
510
- // we however cannot end up with errors in `Relate` during both
511
- // `type_of` and `predicates_of`. This means that evaluating the
512
- // constants should not cause cycle errors here.
513
- let sz_a = sz_a. try_eval_target_usize ( tcx, relation. param_env ( ) ) ;
514
- let sz_b = sz_b. try_eval_target_usize ( tcx, relation. param_env ( ) ) ;
508
+ let sz_a = sz_a. try_to_target_usize ( tcx) ;
509
+ let sz_b = sz_b. try_to_target_usize ( tcx) ;
510
+
515
511
match ( sz_a, sz_b) {
516
512
( Some ( sz_a_val) , Some ( sz_b_val) ) if sz_a_val != sz_b_val => Err (
517
513
TypeError :: FixedArraySize ( expected_found ( relation, sz_a_val, sz_b_val) ) ,
You can’t perform that action at this time.
0 commit comments