Skip to content

Commit 4b7a348

Browse files
committed
ICE on RawPtrComparison check
1 parent 71e162e commit 4b7a348

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_const_eval/src/transform/check_consts

1 file changed

+4
-4
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use rustc_trait_selection::traits::SelectionContext;
2323

2424
use super::ConstCx;
2525
use crate::errors::{
26-
MutDerefErr, NonConstOpErr, PanicNonStrErr, RawPtrComparisonErr, RawPtrToIntErr,
27-
StaticAccessErr, TransientMutBorrowErr, TransientMutBorrowErrRaw,
26+
MutDerefErr, NonConstOpErr, PanicNonStrErr, RawPtrToIntErr, StaticAccessErr,
27+
TransientMutBorrowErr, TransientMutBorrowErrRaw,
2828
};
2929
use crate::util::{call_kind, CallDesugaringKind, CallKind};
3030

@@ -654,10 +654,10 @@ pub struct RawPtrComparison;
654654
impl<'tcx> NonConstOp<'tcx> for RawPtrComparison {
655655
fn build_error(
656656
&self,
657-
ccx: &ConstCx<'_, 'tcx>,
657+
_: &ConstCx<'_, 'tcx>,
658658
span: Span,
659659
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
660-
ccx.tcx.sess.create_err(RawPtrComparisonErr { span })
660+
span_bug!(span, "raw ptr comparison should already be caught in the trait system");
661661
}
662662
}
663663

0 commit comments

Comments
 (0)