about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-10-30 04:50:01 -0400
committerNiko Matsakis <niko@alum.mit.edu>2017-11-02 04:40:50 -0400
commit7b30e8d6681b10d6b7ecf92aa52d3085c5218a85 (patch)
treebd56072e52b2747fc979fe8930347453e4c9832e
parent87c0c327685ba32120151622d0c56c89b5903f0f (diff)
downloadrust-7b30e8d6681b10d6b7ecf92aa52d3085c5218a85.tar.gz
rust-7b30e8d6681b10d6b7ecf92aa52d3085c5218a85.zip
convert (lexical) region errors to warn when NLL is enabled
-rw-r--r--src/librustc/infer/error_reporting/mod.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs
index 33fac8193a6..3fbc7d90354 100644
--- a/src/librustc/infer/error_reporting/mod.rs
+++ b/src/librustc/infer/error_reporting/mod.rs
@@ -265,17 +265,18 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
         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::ConcreteFailure(ref origin, ..) |
+                    RegionResolutionError::GenericBoundFailure(ref origin, ..) => {
+                        self.tcx.sess.span_warn(
+                            origin.span(),
+                            &format!("not reporting region error due to -Znll: {:?}",
+                                     error));
                     }
 
-                    RegionResolutionError::SubSupConflict(rvo, ..) => {
-                        self.tcx.sess.delay_span_bug(rvo.span(),
-                                                     &format!("unreported region error {:?}",
-                                                              error));
+                    RegionResolutionError::SubSupConflict(ref rvo, ..) => {
+                        self.tcx.sess.span_warn(
+                            rvo.span(),
+                            &format!("not reporting region error due to -Znll: {:?}", error));
                     }
                 }
             }