Fix an ICE caused by type mismatch errors being ignored
This commit is contained in:
parent
5eacec9ec7
commit
dec7fc3ced
3 changed files with 13 additions and 6 deletions
|
|
@ -145,12 +145,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
let expr_ty = self.resolve_vars_with_obligations(checked_ty);
|
||||
let mut err = self.report_mismatched_types(&cause, expected, expr_ty, e);
|
||||
|
||||
if self.is_assign_to_bool(expr, expected) {
|
||||
// Error reported in `check_assign` so avoid emitting error again.
|
||||
err.delay_as_bug();
|
||||
return (expected, None);
|
||||
}
|
||||
|
||||
self.emit_coerce_suggestions(&mut err, expr, expr_ty, expected, expected_ty_expr);
|
||||
|
||||
(expected, Some(err))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue