Skip to content

Commit 6f0cc91

Browse files
bors[bot]Avi-D-codermatklad
authored
Merge #4803
4803: Parse default unsafe fn r=matklad a=Avi-D-coder Co-authored-by: Avi Dessauer <[email protected]> Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 7ae2228 + 2785362 commit 6f0cc91

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

crates/ra_parser/src/grammar/items.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul
121121
T![unsafe] => {
122122
// test default_unsafe_impl
123123
// default unsafe impl Foo {}
124-
if p.nth(2) == T![impl] {
124+
125+
// test default_unsafe_fn
126+
// impl T for Foo {
127+
// default unsafe fn foo() {}
128+
// }
129+
if p.nth(2) == T![impl] || p.nth(2) == T![fn] {
125130
p.bump_remap(T![default]);
126131
p.bump(T![unsafe]);
127132
has_mods = true;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
impl T for Foo {
2+
default unsafe fn foo() {}
3+
}

0 commit comments

Comments
 (0)