]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/coercion.rs
Change to Ty::is_inhabited_from
[rust.git] / compiler / rustc_hir_typeck / src / coercion.rs
index c1e4ab600f34f204242165cba1ed560b1fd580cb..af0b7f62ae3195f6ce058bde7b0cf97be631efc1 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"