File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/librustc_mir/borrow_check Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,9 @@ fn do_mir_borrowck<'a, 'tcx>(
136
136
137
137
// Gather the upvars of a closure, if any.
138
138
let tables = tcx. typeck_tables_of ( def_id) ;
139
+ if tables. tainted_by_errors {
140
+ infcx. set_tainted_by_errors ( ) ;
141
+ }
139
142
let upvars: Vec < _ > = tables
140
143
. upvar_list
141
144
. get ( & def_id)
Original file line number Diff line number Diff line change @@ -282,6 +282,11 @@ pub(in crate::borrow_check) fn compute_regions<'cx, 'tcx>(
282
282
let ( closure_region_requirements, nll_errors) =
283
283
regioncx. solve ( infcx, & body, def_id, polonius_output. clone ( ) ) ;
284
284
285
+ if !nll_errors. is_empty ( ) {
286
+ // Suppress unhelpful extra errors in `infer_opaque_types`.
287
+ infcx. set_tainted_by_errors ( ) ;
288
+ }
289
+
285
290
let remapped_opaque_tys = regioncx. infer_opaque_types ( & infcx, opaque_type_values, body. span ) ;
286
291
287
292
NllOutput {
You can’t perform that action at this time.
0 commit comments