mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
feat: initial support for safe_kw in extern blocks
This commit is contained in:
parent
687b72c36a
commit
9f1e450c4f
12 changed files with 264 additions and 9 deletions
|
@ -135,6 +135,11 @@ pub(super) fn opt_item(p: &mut Parser<'_>, m: Marker) -> Result<(), Marker> {
|
|||
has_mods = true;
|
||||
}
|
||||
|
||||
if p.at(T![safe]) {
|
||||
p.eat(T![safe]);
|
||||
has_mods = true;
|
||||
}
|
||||
|
||||
if p.at(T![extern]) {
|
||||
has_extern = true;
|
||||
has_mods = true;
|
||||
|
@ -189,6 +194,7 @@ pub(super) fn opt_item(p: &mut Parser<'_>, m: Marker) -> Result<(), Marker> {
|
|||
T![fn] => fn_(p, m),
|
||||
|
||||
T![const] if p.nth(1) != T!['{'] => consts::konst(p, m),
|
||||
T![static] if matches!(p.nth(1), IDENT | T![_] | T![mut]) => consts::static_(p, m),
|
||||
|
||||
T![trait] => traits::trait_(p, m),
|
||||
T![impl] => traits::impl_(p, m),
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue