Skip to content

Commit

Permalink
Update error format for E0130
Browse files Browse the repository at this point in the history
  • Loading branch information
trixnz committed Aug 4, 2016
1 parent e804a3c commit 625fc29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/librustc_passes/ast_validation.rs
Expand Up @@ -169,6 +169,8 @@ impl<'a> Visitor for AstValidator<'a> {
self.check_decl_no_pat(decl, |span, is_recent| {
let mut err = struct_span_err!(self.session, span, E0130,
"patterns aren't allowed in foreign function declarations");
err.span_label(span, &format!("pattern not allowed in foreign function"));

if is_recent {
err.span_note(span, "this is a recent error, see \
issue #35203 for more details");
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0130.rs
Expand Up @@ -9,7 +9,9 @@
// except according to those terms.

extern {
fn foo((a, b): (u32, u32)); //~ ERROR E0130
fn foo((a, b): (u32, u32));
//~^ ERROR E0130
//~| NOTE pattern not allowed in foreign function
}

fn main() {
Expand Down

0 comments on commit 625fc29

Please sign in to comment.