mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Parse default unsafe fn
This commit is contained in:
parent
3999bbba1b
commit
e38685cb48
3 changed files with 50 additions and 1 deletions
|
@ -121,7 +121,13 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul
|
|||
T![unsafe] => {
|
||||
// test default_unsafe_impl
|
||||
// default unsafe impl Foo {}
|
||||
if p.nth(2) == T![impl] {
|
||||
|
||||
// test default_unsafe_fn
|
||||
// impl T for Foo {
|
||||
// default unsafe fn foo() {}
|
||||
// }
|
||||
let sk = p.nth(2);
|
||||
if sk == T![impl] || sk == T![fn] {
|
||||
p.bump_remap(T![default]);
|
||||
p.bump(T![unsafe]);
|
||||
has_mods = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue