1
Fork 0

Rollup merge of #96629 - ken-matsui:fix-invalid-keyword-order-for-function-declarations, r=davidtwco

Fix invalid keyword order for function declarations

Closes: https://github.com/rust-lang/rust/issues/94879
This commit is contained in:
Yuki Okushi 2022-05-03 14:59:01 +09:00 committed by GitHub
commit 0340703b78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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`