@@ -708,7 +708,6 @@ impl<'a> InferenceContext<'a> {
708
708
tuple_field_access_types : _,
709
709
coercion_casts,
710
710
} = & mut result;
711
-
712
711
table. fallback_if_possible ( ) ;
713
712
714
713
// Comment from rustc:
@@ -754,7 +753,7 @@ impl<'a> InferenceContext<'a> {
754
753
* has_errors = * has_errors || ty. contains_unknown ( ) ;
755
754
}
756
755
757
- * has_errors = !type_mismatches. is_empty ( ) ;
756
+ * has_errors | = !type_mismatches. is_empty ( ) ;
758
757
759
758
type_mismatches. retain ( |_, mismatch| {
760
759
mismatch. expected = table. resolve_completely ( mismatch. expected . clone ( ) ) ;
@@ -797,20 +796,30 @@ impl<'a> InferenceContext<'a> {
797
796
} ) ;
798
797
for ( _, subst) in method_resolutions. values_mut ( ) {
799
798
* subst = table. resolve_completely ( subst. clone ( ) ) ;
799
+ * has_errors =
800
+ * has_errors || subst. type_parameters ( Interner ) . any ( |ty| ty. contains_unknown ( ) ) ;
800
801
}
801
802
for ( _, subst) in assoc_resolutions. values_mut ( ) {
802
803
* subst = table. resolve_completely ( subst. clone ( ) ) ;
804
+ * has_errors =
805
+ * has_errors || subst. type_parameters ( Interner ) . any ( |ty| ty. contains_unknown ( ) ) ;
803
806
}
804
807
for adjustment in expr_adjustments. values_mut ( ) . flatten ( ) {
805
808
adjustment. target = table. resolve_completely ( adjustment. target . clone ( ) ) ;
809
+ * has_errors = * has_errors || adjustment. target . contains_unknown ( ) ;
806
810
}
807
811
for adjustment in pat_adjustments. values_mut ( ) . flatten ( ) {
808
812
* adjustment = table. resolve_completely ( adjustment. clone ( ) ) ;
813
+ * has_errors = * has_errors || adjustment. contains_unknown ( ) ;
809
814
}
810
815
result. tuple_field_access_types = tuple_field_accesses_rev
811
816
. into_iter ( )
812
817
. enumerate ( )
813
818
. map ( |( idx, subst) | ( TupleId ( idx as u32 ) , table. resolve_completely ( subst) ) )
819
+ . inspect ( |( _, subst) | {
820
+ * has_errors =
821
+ * has_errors || subst. type_parameters ( Interner ) . any ( |ty| ty. contains_unknown ( ) ) ;
822
+ } )
814
823
. collect ( ) ;
815
824
result
816
825
}
0 commit comments