This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/tools/rust-analyzer/crates/hir-ty/src Expand file tree Collapse file tree 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> {
701701 table. propagate_diverging_flag ( ) ;
702702 for ty in type_of_expr. values_mut ( ) {
703703 * ty = table. resolve_completely ( ty. clone ( ) ) ;
704+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
704705 }
705706 for ty in type_of_pat. values_mut ( ) {
706707 * ty = table. resolve_completely ( ty. clone ( ) ) ;
708+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
707709 }
708710 for ty in type_of_binding. values_mut ( ) {
709711 * ty = table. resolve_completely ( ty. clone ( ) ) ;
712+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
710713 }
711714 for ty in type_of_rpit. values_mut ( ) {
712715 * ty = table. resolve_completely ( ty. clone ( ) ) ;
716+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
713717 }
714718 for ty in type_of_for_iterator. values_mut ( ) {
715719 * ty = table. resolve_completely ( ty. clone ( ) ) ;
720+ * has_errors = * has_errors || ty. contains_unknown ( ) ;
716721 }
717722
718723 * 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(
21602160 root_expr : ExprId ,
21612161) -> Result < MirBody > {
21622162 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 ) ) ;
21662164 }
21672165 let mut ctx = MirLowerCtx :: new ( db, owner, body, infer) ;
21682166 // 0 is return local
You can’t perform that action at this time.
0 commit comments