mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Set tainted errors bit before emitting coerce suggestions.
This commit is contained in:
parent
93ab13b4e8
commit
fb8636fc48
@ -1479,6 +1479,10 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(coercion_error) => {
|
Err(coercion_error) => {
|
||||||
|
// Mark that we've failed to coerce the types here to suppress
|
||||||
|
// any superfluous errors we might encounter while trying to
|
||||||
|
// emit or provide suggestions on how to fix the initial error.
|
||||||
|
fcx.set_tainted_by_errors();
|
||||||
let (expected, found) = if label_expression_as_expected {
|
let (expected, found) = if label_expression_as_expected {
|
||||||
// In the case where this is a "forced unit", like
|
// In the case where this is a "forced unit", like
|
||||||
// `break`, we want to call the `()` "expected"
|
// `break`, we want to call the `()` "expected"
|
||||||
|
Loading…
Reference in New Issue
Block a user