Skip to content

Commit 325b7d4

Browse files
Continue const-checking after errors when easy
This doesn't change any UI test output
1 parent 4d343a5 commit 325b7d4

File tree

1 file changed

+0
-24
lines changed
  • compiler/rustc_mir/src/transform/check_consts

1 file changed

+0
-24
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ pub trait NonConstOp: std::fmt::Debug {
101101
#[derive(Debug)]
102102
pub struct Abort;
103103
impl NonConstOp for Abort {
104-
const STOPS_CONST_CHECKING: bool = true;
105-
106104
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
107105
mcf_status_in_item(ccx)
108106
}
@@ -115,8 +113,6 @@ impl NonConstOp for Abort {
115113
#[derive(Debug)]
116114
pub struct FloatingPointOp;
117115
impl NonConstOp for FloatingPointOp {
118-
const STOPS_CONST_CHECKING: bool = true;
119-
120116
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
121117
if ccx.const_kind() == hir::ConstContext::ConstFn {
122118
Status::Unstable(sym::const_fn_floating_point_arithmetic)
@@ -136,20 +132,6 @@ impl NonConstOp for FloatingPointOp {
136132
}
137133
}
138134

139-
#[derive(Debug)]
140-
pub struct NonPrimitiveOp;
141-
impl NonConstOp for NonPrimitiveOp {
142-
const STOPS_CONST_CHECKING: bool = true;
143-
144-
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
145-
mcf_status_in_item(ccx)
146-
}
147-
148-
fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) {
149-
mcf_emit_error(ccx, span, "only int, `bool` and `char` operations are stable in const fn")
150-
}
151-
}
152-
153135
/// A function call where the callee is a pointer.
154136
#[derive(Debug)]
155137
pub struct FnCallIndirect;
@@ -234,8 +216,6 @@ impl NonConstOp for FnPtrCast {
234216
#[derive(Debug)]
235217
pub struct Generator;
236218
impl NonConstOp for Generator {
237-
const STOPS_CONST_CHECKING: bool = true;
238-
239219
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
240220
// FIXME: This means generator-only MIR is only forbidden in const fn. This is for
241221
// compatibility with the old code. Such MIR should be forbidden everywhere.
@@ -512,8 +492,6 @@ impl NonConstOp for ThreadLocalAccess {
512492
#[derive(Debug)]
513493
pub struct Transmute;
514494
impl NonConstOp for Transmute {
515-
const STOPS_CONST_CHECKING: bool = true;
516-
517495
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
518496
if ccx.const_kind() != hir::ConstContext::ConstFn {
519497
Status::Allowed
@@ -660,8 +638,6 @@ pub mod ty {
660638
#[derive(Debug)]
661639
pub struct TraitBoundNotConst;
662640
impl NonConstOp for TraitBoundNotConst {
663-
const STOPS_CONST_CHECKING: bool = true;
664-
665641
fn status_in_item(&self, _: &ConstCx<'_, '_>) -> Status {
666642
Status::Unstable(sym::const_trait_bound_opt_out)
667643
}

0 commit comments

Comments
 (0)