Rollup merge of #91133 - terrarier2111:unsafe-diagnostic, r=jackh726
Improve `unsafe` diagnostic This fixes: https://github.com/rust-lang/rust/issues/90880 I didn't use the exact proposed messages though.
This commit is contained in:
commit
c8133f6f5e
2 changed files with 31 additions and 4 deletions
|
|
@ -4,10 +4,15 @@ error: expected `{`, found keyword `unsafe`
|
|||
LL | trait T {
|
||||
| - while parsing this item list starting here
|
||||
LL | extern "Rust" unsafe fn foo();
|
||||
| ^^^^^^ expected `{`
|
||||
| --------------^^^^^^
|
||||
| | |
|
||||
| | expected `{`
|
||||
| help: `unsafe` must come before `extern "Rust"`: `unsafe extern "Rust"`
|
||||
LL |
|
||||
LL | }
|
||||
| - the item list ends here
|
||||
|
|
||||
= note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue