Skip to content

Commit

Permalink
New format for E0426
Browse files Browse the repository at this point in the history
Issue #35799 as a part of issue #35233
?r jonathandturner
  • Loading branch information
tvladyslav committed Aug 19, 2016
1 parent 413ada3 commit 5d02b03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0426.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

fn main () {
loop {
break 'a; //~ ERROR E0426
break 'a;
//~^ ERROR E0426
//~| NOTE undeclared label `'a`
}
}

0 comments on commit 5d02b03

Please sign in to comment.