From 5d02b030598bc1a4e7a0b1255c0eae0f21a5413a Mon Sep 17 00:00:00 2001 From: crypto-universe Date: Fri, 19 Aug 2016 22:31:31 +0200 Subject: [PATCH] New format for E0426 Issue #35799 as a part of issue #35233 ?r jonathandturner --- src/librustc_resolve/lib.rs | 12 +++++++----- src/test/compile-fail/E0426.rs | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index b91ede5b2fa..af727de4256 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -390,11 +390,13 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>, err } ResolutionError::UndeclaredLabel(name) => { - struct_span_err!(resolver.session, - span, - E0426, - "use of undeclared label `{}`", - name) + let mut err = struct_span_err!(resolver.session, + span, + E0426, + "use of undeclared label `{}`", + name); + err.span_label(span, &format!("undeclared label `{}`",&name)); + err } ResolutionError::SelfImportsOnlyAllowedWithin => { struct_span_err!(resolver.session, diff --git a/src/test/compile-fail/E0426.rs b/src/test/compile-fail/E0426.rs index 2eb4c2d3b5e..be21421cb07 100644 --- a/src/test/compile-fail/E0426.rs +++ b/src/test/compile-fail/E0426.rs @@ -10,6 +10,8 @@ fn main () { loop { - break 'a; //~ ERROR E0426 + break 'a; + //~^ ERROR E0426 + //~| NOTE undeclared label `'a` } }