]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/coherence.rs
Delay span bug when failing to normalize negative coherence impl subject due to other...
[rust.git] / compiler / rustc_trait_selection / src / traits / coherence.rs
index 8ab1aa65d3a9f43dccd5460bbdc5f3dce4af1a1e..38e2500da9bb34d936a7905841d062b5eec15668 100644 (file)
@@ -307,7 +307,13 @@ fn negative_impl<'cx, 'tcx>(
             tcx.impl_subject(impl1_def_id),
         ) {
             Ok(s) => s,
-            Err(err) => bug!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
+            Err(err) => {
+                tcx.sess.delay_span_bug(
+                    tcx.def_span(impl1_def_id),
+                    format!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
+                );
+                return false;
+            }
         };
 
         // Attempt to prove that impl2 applies, given all of the above.