@@ -101,8 +101,6 @@ pub trait NonConstOp: std::fmt::Debug {
101
101
#[ derive( Debug ) ]
102
102
pub struct Abort ;
103
103
impl NonConstOp for Abort {
104
- const STOPS_CONST_CHECKING : bool = true ;
105
-
106
104
fn status_in_item ( & self , ccx : & ConstCx < ' _ , ' _ > ) -> Status {
107
105
mcf_status_in_item ( ccx)
108
106
}
@@ -115,8 +113,6 @@ impl NonConstOp for Abort {
115
113
#[ derive( Debug ) ]
116
114
pub struct FloatingPointOp ;
117
115
impl NonConstOp for FloatingPointOp {
118
- const STOPS_CONST_CHECKING : bool = true ;
119
-
120
116
fn status_in_item ( & self , ccx : & ConstCx < ' _ , ' _ > ) -> Status {
121
117
if ccx. const_kind ( ) == hir:: ConstContext :: ConstFn {
122
118
Status :: Unstable ( sym:: const_fn_floating_point_arithmetic)
@@ -136,20 +132,6 @@ impl NonConstOp for FloatingPointOp {
136
132
}
137
133
}
138
134
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
-
153
135
/// A function call where the callee is a pointer.
154
136
#[ derive( Debug ) ]
155
137
pub struct FnCallIndirect ;
@@ -234,8 +216,6 @@ impl NonConstOp for FnPtrCast {
234
216
#[ derive( Debug ) ]
235
217
pub struct Generator ;
236
218
impl NonConstOp for Generator {
237
- const STOPS_CONST_CHECKING : bool = true ;
238
-
239
219
fn status_in_item ( & self , ccx : & ConstCx < ' _ , ' _ > ) -> Status {
240
220
// FIXME: This means generator-only MIR is only forbidden in const fn. This is for
241
221
// compatibility with the old code. Such MIR should be forbidden everywhere.
@@ -512,8 +492,6 @@ impl NonConstOp for ThreadLocalAccess {
512
492
#[ derive( Debug ) ]
513
493
pub struct Transmute ;
514
494
impl NonConstOp for Transmute {
515
- const STOPS_CONST_CHECKING : bool = true ;
516
-
517
495
fn status_in_item ( & self , ccx : & ConstCx < ' _ , ' _ > ) -> Status {
518
496
if ccx. const_kind ( ) != hir:: ConstContext :: ConstFn {
519
497
Status :: Allowed
@@ -660,8 +638,6 @@ pub mod ty {
660
638
#[ derive( Debug ) ]
661
639
pub struct TraitBoundNotConst ;
662
640
impl NonConstOp for TraitBoundNotConst {
663
- const STOPS_CONST_CHECKING : bool = true ;
664
-
665
641
fn status_in_item ( & self , _: & ConstCx < ' _ , ' _ > ) -> Status {
666
642
Status :: Unstable ( sym:: const_trait_bound_opt_out)
667
643
}
0 commit comments