]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/liveness.rs
rollup merge of #21457: alexcrichton/issue-21436
[rust.git] / src / librustc / middle / liveness.rs
index 7402bfc1efd5d88645f0cbb2fed4193d17cfb392..43989d0aadc8adf1322e8cc744f4cb7cd13958cf 100644 (file)
@@ -1557,8 +1557,7 @@ fn check_ret(&self,
                             },
                         _ => false
                     };
-                    self.ir.tcx.sess.span_err(
-                        sp, "not all control paths return a value");
+                    span_err!(self.ir.tcx.sess, sp, E0269, "not all control paths return a value");
                     if ends_with_stmt {
                         let last_stmt = body.stmts.first().unwrap();
                         let original_span = original_sp(self.ir.tcx.sess.codemap(),
@@ -1575,7 +1574,7 @@ fn check_ret(&self,
             }
             ty::FnDiverging
                 if self.live_on_entry(entry_ln, self.s.clean_exit_var).is_some() => {
-                    self.ir.tcx.sess.span_err(sp,
+                    span_err!(self.ir.tcx.sess, sp, E0270,
                         "computation may converge in a function marked as diverging");
                 }