diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-08-11 06:33:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-11 06:33:57 -0700 |
| commit | 260a379ba525ee457e336b98cb0634252b6ec1ab (patch) | |
| tree | 6fe2fa2d6f861eee7221546ade6318991529f8d7 | |
| parent | 476e49614d99fe31d26f851eddf9b9afe1294745 (diff) | |
| parent | e2cc1571ba5b64223561910ad3be9a4d63552f26 (diff) | |
| download | rust-260a379ba525ee457e336b98cb0634252b6ec1ab.tar.gz rust-260a379ba525ee457e336b98cb0634252b6ec1ab.zip | |
Rollup merge of #35331 - trixnz:update-error-130, r=jonathandturner
Update error format for E0130 Fixes #35256 as part of #35233 r? @jonathandturner
| -rw-r--r-- | src/librustc_passes/ast_validation.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/E0130.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/no-patterns-in-args.rs | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index 91d2500564f..341c9d820e6 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -183,6 +183,7 @@ impl<'a> Visitor for AstValidator<'a> { 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"); diff --git a/src/test/compile-fail/E0130.rs b/src/test/compile-fail/E0130.rs index ef5961e1338..e9e027fd1dc 100644 --- a/src/test/compile-fail/E0130.rs +++ b/src/test/compile-fail/E0130.rs @@ -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() { diff --git a/src/test/compile-fail/no-patterns-in-args.rs b/src/test/compile-fail/no-patterns-in-args.rs index 3edbdf4ebc9..b0278476998 100644 --- a/src/test/compile-fail/no-patterns-in-args.rs +++ b/src/test/compile-fail/no-patterns-in-args.rs @@ -10,10 +10,13 @@ extern { fn f1(mut arg: u8); //~ ERROR patterns aren't allowed in foreign function declarations - //~^ NOTE this is a recent error + //~^ NOTE pattern not allowed in foreign function + //~| NOTE this is a recent error fn f2(&arg: u8); //~ ERROR patterns aren't allowed in foreign function declarations + //~^ NOTE pattern not allowed in foreign function fn f3(arg @ _: u8); //~ ERROR patterns aren't allowed in foreign function declarations - //~^ NOTE this is a recent error + //~^ NOTE pattern not allowed in foreign function + //~| NOTE this is a recent error fn g1(arg: u8); // OK fn g2(_: u8); // OK // fn g3(u8); // Not yet |
