Skip to content

Commit

Permalink
ICE on RawPtrComparison check
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Jul 26, 2022
1 parent 71e162e commit 4b7a348
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_const_eval/src/transform/check_consts/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use rustc_trait_selection::traits::SelectionContext;

use super::ConstCx;
use crate::errors::{
MutDerefErr, NonConstOpErr, PanicNonStrErr, RawPtrComparisonErr, RawPtrToIntErr,
StaticAccessErr, TransientMutBorrowErr, TransientMutBorrowErrRaw,
MutDerefErr, NonConstOpErr, PanicNonStrErr, RawPtrToIntErr, StaticAccessErr,
TransientMutBorrowErr, TransientMutBorrowErrRaw,
};
use crate::util::{call_kind, CallDesugaringKind, CallKind};

Expand Down Expand Up @@ -654,10 +654,10 @@ pub struct RawPtrComparison;
impl<'tcx> NonConstOp<'tcx> for RawPtrComparison {
fn build_error(
&self,
ccx: &ConstCx<'_, 'tcx>,
_: &ConstCx<'_, 'tcx>,
span: Span,
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
ccx.tcx.sess.create_err(RawPtrComparisonErr { span })
span_bug!(span, "raw ptr comparison should already be caught in the trait system");
}
}

Expand Down

0 comments on commit 4b7a348

Please sign in to comment.