Skip to content

Commit aebe1d5

Browse files
Rollup merge of #35331 - trixnz:update-error-130, r=jonathandturner
Update error format for E0130 Fixes #35256 as part of #35233 r? @jonathandturner
2 parents 11f3da8 + 625fc29 commit aebe1d5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/librustc_passes/ast_validation.rs

+2
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ impl<'a> Visitor for AstValidator<'a> {
169169
self.check_decl_no_pat(decl, |span, is_recent| {
170170
let mut err = struct_span_err!(self.session, span, E0130,
171171
"patterns aren't allowed in foreign function declarations");
172+
err.span_label(span, &format!("pattern not allowed in foreign function"));
173+
172174
if is_recent {
173175
err.span_note(span, "this is a recent error, see \
174176
issue #35203 for more details");

src/test/compile-fail/E0130.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
extern {
12-
fn foo((a, b): (u32, u32)); //~ ERROR E0130
12+
fn foo((a, b): (u32, u32));
13+
//~^ ERROR E0130
14+
//~| NOTE pattern not allowed in foreign function
1315
}
1416

1517
fn main() {

0 commit comments

Comments
 (0)