Optimize the diagnostic generation for extern unsafe

This commit is contained in:
SparrowLii 2022-05-30 15:56:43 +08:00
parent 56d540e057
commit 0be2ca96fa
4 changed files with 52 additions and 32 deletions

View file

@ -4,15 +4,10 @@ error: expected `{`, found keyword `unsafe`
LL | trait T {
| - while parsing this item list starting here
LL | extern "Rust" unsafe fn foo();
| --------------^^^^^^
| | |
| | expected `{`
| help: `unsafe` must come before `extern "Rust"`: `unsafe extern "Rust"`
| ^^^^^^ expected `{`
LL |
LL | }
| - the item list ends here
|
= note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error