We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eac922e commit 147e850Copy full SHA for 147e850
compiler/rustc_const_eval/src/transform/check_consts/ops.rs
@@ -610,10 +610,11 @@ pub struct RawPtrComparison;
610
impl<'tcx> NonConstOp<'tcx> for RawPtrComparison {
611
fn build_error(
612
&self,
613
- _: &ConstCx<'_, 'tcx>,
+ ccx: &ConstCx<'_, 'tcx>,
614
span: Span,
615
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
616
- span_bug!(span, "raw ptr comparison should already be caught in the trait system");
+ // FIXME(const_trait_impl): revert to span_bug?
617
+ ccx.tcx.sess.create_err(errors::RawPtrComparisonErr { span })
618
}
619
620
0 commit comments