Skip to content

Commit 147e850

Browse files
committed
revive raw pointer comp error
1 parent eac922e commit 147e850

File tree

1 file changed

+3
-2
lines changed
  • compiler/rustc_const_eval/src/transform/check_consts

1 file changed

+3
-2
lines changed

compiler/rustc_const_eval/src/transform/check_consts/ops.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,11 @@ pub struct RawPtrComparison;
610610
impl<'tcx> NonConstOp<'tcx> for RawPtrComparison {
611611
fn build_error(
612612
&self,
613-
_: &ConstCx<'_, 'tcx>,
613+
ccx: &ConstCx<'_, 'tcx>,
614614
span: Span,
615615
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
616-
span_bug!(span, "raw ptr comparison should already be caught in the trait system");
616+
// FIXME(const_trait_impl): revert to span_bug?
617+
ccx.tcx.sess.create_err(errors::RawPtrComparisonErr { span })
617618
}
618619
}
619620

0 commit comments

Comments
 (0)