@@ -163,11 +163,6 @@ pub struct Validator<'a, 'mir, 'tcx> {
163
163
/// this set is empty. Note that if we start removing locals from
164
164
/// `derived_from_illegal_borrow`, just checking at the end won't be enough.
165
165
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 ,
171
166
}
172
167
173
168
impl Deref for Validator < ' _ , ' mir , ' tcx > {
@@ -221,9 +216,7 @@ impl Validator<'a, 'mir, 'tcx> {
221
216
span : item. body . span ,
222
217
item,
223
218
qualifs,
224
- errors : vec ! [ ] ,
225
219
derived_from_illegal_borrow : BitSet :: new_empty ( item. body . local_decls . len ( ) ) ,
226
- suppress_errors : false ,
227
220
}
228
221
}
229
222
@@ -267,10 +260,6 @@ impl Validator<'a, 'mir, 'tcx> {
267
260
self . qualifs . in_return_place ( self . item )
268
261
}
269
262
270
- pub fn take_errors ( & mut self ) -> Vec < ( Span , String ) > {
271
- std:: mem:: replace ( & mut self . errors , vec ! [ ] )
272
- }
273
-
274
263
/// Emits an error at the given `span` if an expression cannot be evaluated in the current
275
264
/// context. Returns `Forbidden` if an error was emitted.
276
265
pub fn check_op_spanned < O > ( & mut self , op : O , span : Span ) -> CheckOpResult
@@ -293,11 +282,7 @@ impl Validator<'a, 'mir, 'tcx> {
293
282
return CheckOpResult :: Unleashed ;
294
283
}
295
284
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) ;
301
286
CheckOpResult :: Forbidden
302
287
}
303
288
0 commit comments