Rollup merge of #35331 - trixnz:update-error-130, r=jonathandturner
Update error format for E0130 Fixes #35256 as part of #35233 r? @jonathandturner
This commit is contained in:
commit
260a379ba5
@ -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");
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user