@@ -163,11 +163,6 @@ pub struct Validator<'a, 'mir, 'tcx> {
163163 /// this set is empty. Note that if we start removing locals from
164164 /// `derived_from_illegal_borrow`, just checking at the end won't be enough.
165165 derived_from_illegal_borrow : BitSet < Local > ,
166-
167- errors : Vec < ( Span , String ) > ,
168-
169- /// Whether to actually emit errors or just store them in `errors`.
170- pub ( crate ) suppress_errors : bool ,
171166}
172167
173168impl Deref for Validator < ' _ , ' mir , ' tcx > {
@@ -221,9 +216,7 @@ impl Validator<'a, 'mir, 'tcx> {
221216 span : item. body . span ,
222217 item,
223218 qualifs,
224- errors : vec ! [ ] ,
225219 derived_from_illegal_borrow : BitSet :: new_empty ( item. body . local_decls . len ( ) ) ,
226- suppress_errors : false ,
227220 }
228221 }
229222
@@ -267,10 +260,6 @@ impl Validator<'a, 'mir, 'tcx> {
267260 self . qualifs . in_return_place ( self . item )
268261 }
269262
270- pub fn take_errors ( & mut self ) -> Vec < ( Span , String ) > {
271- std:: mem:: replace ( & mut self . errors , vec ! [ ] )
272- }
273-
274263 /// Emits an error at the given `span` if an expression cannot be evaluated in the current
275264 /// context. Returns `Forbidden` if an error was emitted.
276265 pub fn check_op_spanned < O > ( & mut self , op : O , span : Span ) -> CheckOpResult
@@ -293,11 +282,7 @@ impl Validator<'a, 'mir, 'tcx> {
293282 return CheckOpResult :: Unleashed ;
294283 }
295284
296- if !self . suppress_errors {
297- op. emit_error ( self , span) ;
298- }
299-
300- self . errors . push ( ( span, format ! ( "{:?}" , op) ) ) ;
285+ op. emit_error ( self , span) ;
301286 CheckOpResult :: Forbidden
302287 }
303288
0 commit comments