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 @@ -139,6 +139,9 @@ fn do_mir_borrowck<'a, 'tcx>(
139139
140140 // Gather the upvars of a closure, if any.
141141 let tables = tcx. typeck_tables_of ( def_id) ;
142+ if tables. tainted_by_errors {
143+ infcx. set_tainted_by_errors ( ) ;
144+ }
142145 let upvars: Vec < _ > = tables
143146 . upvar_list
144147 . 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>(
282282 let ( closure_region_requirements, nll_errors) =
283283 regioncx. solve ( infcx, & body, def_id, polonius_output. clone ( ) ) ;
284284
285+ if !nll_errors. is_empty ( ) {
286+ // Suppress unhelpful extra errors in `infer_opaque_types`.
287+ infcx. set_tainted_by_errors ( ) ;
288+ }
289+
285290 let remapped_opaque_tys = regioncx. infer_opaque_types ( & infcx, opaque_type_values, body. span ) ;
286291
287292 NllOutput {
You can’t perform that action at this time.
0 commit comments