Open
Description
Rust keyword should be used in a given order
pub
default
const
async
unsafe
extern
Rust provides multiple messages and notes to help with that:
5 | extern const pub fn myfun() {
| -------^^^^^
| | |
| | expected `fn`
| help: `const` must come before `extern`: `const extern`
|
= note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
- We do have some
FunctionQualifier
structure to store the state of a function but not all those informations are kept in it. - We parse in different ways those qualifiers and provide multiple error message.
We should probably unify all those under one same structure (FunctionQualifier
) and create a function to parse a FunctionQualifier
that could be used everytime we expect a function.
This function could emit an error as well as a note (rust_note
) when the syntax is wrong.
Choose an appropriate API for this function. Should it return an Optional<FunctionQualifier>
? Always return a FunctionQualifier
with private/safe/sync attributes ? Probably the latter.
Metadata
Metadata
Assignees
Type
Projects
Status
To do