@@ -23,13 +23,6 @@ use super::qualifs::{self, HasMutInterior, NeedsDrop};
23
23
use super :: resolver:: FlowSensitiveAnalysis ;
24
24
use super :: { ConstKind , Item , Qualif , is_lang_panic_fn} ;
25
25
26
- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
27
- pub enum CheckOpResult {
28
- Forbidden ,
29
- Unleashed ,
30
- Allowed ,
31
- }
32
-
33
26
pub type IndirectlyMutableResults < ' mir , ' tcx > =
34
27
old_dataflow:: DataflowResultsCursor < ' mir , ' tcx , IndirectlyMutableLocals < ' mir , ' tcx > > ;
35
28
@@ -246,15 +239,15 @@ impl Validator<'a, 'mir, 'tcx> {
246
239
}
247
240
248
241
/// Emits an error at the given `span` if an expression cannot be evaluated in the current
249
- /// context. Returns `Forbidden` if an error was emitted.
250
- pub fn check_op_spanned < O > ( & mut self , op : O , span : Span ) -> CheckOpResult
242
+ /// context.
243
+ pub fn check_op_spanned < O > ( & mut self , op : O , span : Span )
251
244
where
252
245
O : NonConstOp
253
246
{
254
247
trace ! ( "check_op: op={:?}" , op) ;
255
248
256
249
if op. is_allowed_in_item ( self ) {
257
- return CheckOpResult :: Allowed ;
250
+ return ;
258
251
}
259
252
260
253
// If an operation is supported in miri (and is not already controlled by a feature gate) it
@@ -264,20 +257,19 @@ impl Validator<'a, 'mir, 'tcx> {
264
257
265
258
if is_unleashable && self . tcx . sess . opts . debugging_opts . unleash_the_miri_inside_of_you {
266
259
self . tcx . sess . span_warn ( span, "skipping const checks" ) ;
267
- return CheckOpResult :: Unleashed ;
260
+ return ;
268
261
}
269
262
270
263
op. emit_error ( self , span) ;
271
- CheckOpResult :: Forbidden
272
264
}
273
265
274
266
/// Emits an error if an expression cannot be evaluated in the current context.
275
- pub fn check_op ( & mut self , op : impl NonConstOp ) -> CheckOpResult {
267
+ pub fn check_op ( & mut self , op : impl NonConstOp ) {
276
268
let span = self . span ;
277
269
self . check_op_spanned ( op, span)
278
270
}
279
271
280
- fn check_static ( & mut self , def_id : DefId , span : Span ) -> CheckOpResult {
272
+ fn check_static ( & mut self , def_id : DefId , span : Span ) {
281
273
let is_thread_local = self . tcx . has_attr ( def_id, sym:: thread_local) ;
282
274
if is_thread_local {
283
275
self . check_op_spanned ( ops:: ThreadLocalAccess , span)
0 commit comments