From de201b40c9de12d1e9d709203f8eb425f79148cf Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 26 Oct 2017 21:19:01 -0400 Subject: [PATCH] ignore region errors if NLL is enabled This way, NLL can report them later. --- src/librustc/infer/error_reporting/mod.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index 895894a0bb2..33fac8193a6 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -262,6 +262,27 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { errors: &Vec>) { debug!("report_region_errors(): {} errors to start", errors.len()); + if self.tcx.sess.opts.debugging_opts.nll { + for error in errors { + match *error { + RegionResolutionError::ConcreteFailure(origin, ..) | + RegionResolutionError::GenericBoundFailure(origin, ..) => { + self.tcx.sess.delay_span_bug(origin.span(), + &format!("unreported region error {:?}", + error)); + } + + RegionResolutionError::SubSupConflict(rvo, ..) => { + self.tcx.sess.delay_span_bug(rvo.span(), + &format!("unreported region error {:?}", + error)); + } + } + } + + return; + } + // try to pre-process the errors, which will group some of them // together into a `ProcessedErrors` group: let errors = self.process_errors(errors);