@@ -23,13 +23,6 @@ use super::qualifs::{self, HasMutInterior, NeedsDrop};
2323use super :: resolver:: FlowSensitiveAnalysis ;
2424use super :: { ConstKind , Item , Qualif , is_lang_panic_fn} ;
2525
26- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
27- pub enum CheckOpResult {
28- Forbidden ,
29- Unleashed ,
30- Allowed ,
31- }
32-
3326pub type IndirectlyMutableResults < ' mir , ' tcx > =
3427 old_dataflow:: DataflowResultsCursor < ' mir , ' tcx , IndirectlyMutableLocals < ' mir , ' tcx > > ;
3528
@@ -246,15 +239,15 @@ impl Validator<'a, 'mir, 'tcx> {
246239 }
247240
248241 /// 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 )
251244 where
252245 O : NonConstOp
253246 {
254247 trace ! ( "check_op: op={:?}" , op) ;
255248
256249 if op. is_allowed_in_item ( self ) {
257- return CheckOpResult :: Allowed ;
250+ return ;
258251 }
259252
260253 // 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> {
264257
265258 if is_unleashable && self . tcx . sess . opts . debugging_opts . unleash_the_miri_inside_of_you {
266259 self . tcx . sess . span_warn ( span, "skipping const checks" ) ;
267- return CheckOpResult :: Unleashed ;
260+ return ;
268261 }
269262
270263 op. emit_error ( self , span) ;
271- CheckOpResult :: Forbidden
272264 }
273265
274266 /// 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 ) {
276268 let span = self . span ;
277269 self . check_op_spanned ( op, span)
278270 }
279271
280- fn check_static ( & mut self , def_id : DefId , span : Span ) -> CheckOpResult {
272+ fn check_static ( & mut self , def_id : DefId , span : Span ) {
281273 let is_thread_local = self . tcx . has_attr ( def_id, sym:: thread_local) ;
282274 if is_thread_local {
283275 self . check_op_spanned ( ops:: ThreadLocalAccess , span)
0 commit comments