File tree 2 files changed +6
-3
lines changed
src/tools/rust-analyzer/crates/hir-ty/src 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -701,18 +701,23 @@ impl<'a> InferenceContext<'a> {
701
701
table. propagate_diverging_flag ( ) ;
702
702
for ty in type_of_expr. values_mut ( ) {
703
703
* ty = table. resolve_completely ( ty. clone ( ) ) ;
704
+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
704
705
}
705
706
for ty in type_of_pat. values_mut ( ) {
706
707
* ty = table. resolve_completely ( ty. clone ( ) ) ;
708
+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
707
709
}
708
710
for ty in type_of_binding. values_mut ( ) {
709
711
* ty = table. resolve_completely ( ty. clone ( ) ) ;
712
+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
710
713
}
711
714
for ty in type_of_rpit. values_mut ( ) {
712
715
* ty = table. resolve_completely ( ty. clone ( ) ) ;
716
+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
713
717
}
714
718
for ty in type_of_for_iterator. values_mut ( ) {
715
719
* ty = table. resolve_completely ( ty. clone ( ) ) ;
720
+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
716
721
}
717
722
718
723
* has_errors = !type_mismatches. is_empty ( ) ;
Original file line number Diff line number Diff line change @@ -2160,9 +2160,7 @@ pub fn lower_to_mir(
2160
2160
root_expr : ExprId ,
2161
2161
) -> Result < MirBody > {
2162
2162
if infer. has_errors {
2163
- return Err ( MirLowerError :: TypeMismatch (
2164
- infer. type_mismatches ( ) . next ( ) . map ( |( _, it) | it. clone ( ) ) ,
2165
- ) ) ;
2163
+ return Err ( MirLowerError :: TypeMismatch ( None ) ) ;
2166
2164
}
2167
2165
let mut ctx = MirLowerCtx :: new ( db, owner, body, infer) ;
2168
2166
// 0 is return local
You can’t perform that action at this time.
0 commit comments