]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/coercion.rs
Rollup merge of #104656 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / compiler / rustc_hir_typeck / src / coercion.rs
index 894879d7774253e1f36307899b21807140de911f..cf3b37f0a25088e4e5f00624a8ef172df8b6475a 100644 (file)
@@ -1561,7 +1561,9 @@ pub(crate) fn coerce_inner<'a>(
                 // 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();
+                fcx.set_tainted_by_errors(
+                    fcx.tcx.sess.delay_span_bug(cause.span, "coercion error but no error emitted"),
+                );
                 let (expected, found) = if label_expression_as_expected {
                     // In the case where this is a "forced unit", like
                     // `break`, we want to call the `()` "expected"