From 1cf5142248ca72d4cd1baeb011d665717c741126 Mon Sep 17 00:00:00 2001 From: Jared Wyles Date: Fri, 5 Aug 2016 13:48:24 +1000 Subject: [PATCH] Updated error format for E0069 --- src/librustc_typeck/check/mod.rs | 6 ++++-- src/test/compile-fail/E0069.rs | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 6062bd048b3d2..32688b258d0f6 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3383,8 +3383,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // FIXME(#32730) propagate obligations .map(|InferOk { obligations, .. }| assert!(obligations.is_empty())); if eq_result.is_err() { - span_err!(tcx.sess, expr.span, E0069, - "`return;` in a function whose return type is not `()`"); + struct_span_err!(tcx.sess, expr.span, E0069, + "`return;` in a function whose return type is not `()`") + .span_label(expr.span, &format!("return type is not ()")) + .emit(); } } } diff --git a/src/test/compile-fail/E0069.rs b/src/test/compile-fail/E0069.rs index d164d86348784..00facc9172802 100644 --- a/src/test/compile-fail/E0069.rs +++ b/src/test/compile-fail/E0069.rs @@ -9,7 +9,9 @@ // except according to those terms. fn foo() -> u8 { - return; //~ ERROR E0069 + return; + //~^ ERROR `return;` in a function whose return type is not `()` + //~| NOTE return type is not () } fn main() {