1
Fork 0

Fix invalid keyword order for function declarations

This commit is contained in:
Ken Matsui 2022-05-02 18:14:43 +09:00
parent 4dd8b420c0
commit 6c7f4dee8f
No known key found for this signature in database
GPG key ID: 103360B3298EE433
14 changed files with 36 additions and 14 deletions

View file

@ -1020,7 +1020,7 @@ impl<'a> Parser<'a> {
&format!("`{}` must come before `{}`", invalid_qual, current_qual),
format!("{} {}", invalid_qual, current_qual),
Applicability::MachineApplicable,
).note("keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`");
).note("keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`");
}
}
Err(err)
@ -2086,7 +2086,7 @@ impl<'a> Parser<'a> {
&format!("`{misplaced_qual}` must come before `{current_qual}`"),
format!("{misplaced_qual} {current_qual}"),
Applicability::MachineApplicable,
).note("keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`");
).note("keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`");
}
}
// Recover incorrect visibility order such as `async pub`