Parse default unsafe fn

This commit is contained in:
Avi Dessauer 2020-06-08 17:49:06 -04:00
parent 3999bbba1b
commit e38685cb48
3 changed files with 50 additions and 1 deletions

View file

@ -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;