diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-07-18 23:23:21 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-07-23 14:20:20 +0200 |
| commit | 1a0294bb84d2b4aaf66634f61279bca5e132d1dc (patch) | |
| tree | 5aa27ccc1508c754c084fc20768b61a3f7529269 | |
| parent | ec005ccf84e470a70f8bb8b5347ab8e793fb30a3 (diff) | |
| download | rust-1a0294bb84d2b4aaf66634f61279bca5e132d1dc.tar.gz rust-1a0294bb84d2b4aaf66634f61279bca5e132d1dc.zip | |
Thread the `errors_buffer` down through the NLL region_infer code.
| -rw-r--r-- | src/librustc_mir/borrow_check/nll/region_infer/mod.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/mod.rs b/src/librustc_mir/borrow_check/nll/region_infer/mod.rs index 37df311805e..52f596f61c2 100644 --- a/src/librustc_mir/borrow_check/nll/region_infer/mod.rs +++ b/src/librustc_mir/borrow_check/nll/region_infer/mod.rs @@ -390,7 +390,8 @@ impl<'tcx> RegionInferenceContext<'tcx> { None }; - self.check_type_tests(infcx, mir, mir_def_id, outlives_requirements.as_mut()); + self.check_type_tests( + infcx, mir, mir_def_id, outlives_requirements.as_mut(), errors_buffer); self.check_universal_regions( infcx, mir, mir_def_id, outlives_requirements.as_mut(), errors_buffer); @@ -480,6 +481,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { mir: &Mir<'tcx>, mir_def_id: DefId, mut propagated_outlives_requirements: Option<&mut Vec<ClosureOutlivesRequirement<'gcx>>>, + errors_buffer: &mut Vec<Diagnostic>, ) { let tcx = infcx.tcx; @@ -506,13 +508,13 @@ impl<'tcx> RegionInferenceContext<'tcx> { if let Some(lower_bound_region) = lower_bound_region { let region_scope_tree = &tcx.region_scope_tree(mir_def_id); let type_test_span = type_test.locations.span(mir); - infcx.report_generic_bound_failure( + infcx.construct_generic_bound_failure( region_scope_tree, type_test_span, None, type_test.generic_kind, lower_bound_region, - ); + ).buffer(errors_buffer); } else { // FIXME. We should handle this case better. It // indicates that we have e.g. some region variable @@ -524,10 +526,10 @@ impl<'tcx> RegionInferenceContext<'tcx> { // iterating over the universal regions and reporting // an error that multiple bounds are required. let type_test_span = type_test.locations.span(mir); - tcx.sess.span_err( + tcx.sess.struct_span_err( type_test_span, &format!("`{}` does not live long enough", type_test.generic_kind,), - ); + ).buffer(errors_buffer); } } } |
