]> git.lizzy.rs Git - rust.git/commitdiff
Thread the `errors_buffer` down through the NLL region_infer code.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 18 Jul 2018 21:23:21 +0000 (23:23 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Mon, 23 Jul 2018 12:20:20 +0000 (14:20 +0200)
src/librustc_mir/borrow_check/nll/region_infer/mod.rs

index 37df311805edc47047206d649fe5ea11b1b2f0bf..52f596f61c2e803beba22d2ff46402d28fcf9212 100644 (file)
@@ -390,7 +390,8 @@ fn solve_inner<'gcx>(
             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 @@ fn check_type_tests<'gcx>(
         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 @@ fn check_type_tests<'gcx>(
             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 @@ fn check_type_tests<'gcx>(
                 // 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);
             }
         }
     }