Skip to content

Commit

Permalink
Rollup merge of rust-lang#35835 - crypto-universe:E0426, r=jonathandt…
Browse files Browse the repository at this point in the history
…urner

New format for E0426

Issue rust-lang#35799 as a part of issue rust-lang#35233
r? jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 22, 2016
2 parents 025c5e7 + 5d02b03 commit ae83225
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 @@ -392,11 +392,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 ae83225

Please sign in to comment.