Update async unsafe fn ordering.

As of rust-lang/rust#61319 the correct order for functions that are both
unsafe and async is: `async unsafe fn` and not `unsafe async fn`.

This commit updates the parser tests to reflect this, and corrects
parsing behavior to accept the correct ordering.

Fixes #3025
This commit is contained in:
Emil Lauridsen 2020-02-07 13:51:51 +01:00
parent 5aba5a756a
commit 73ec2ab184
5 changed files with 20 additions and 20 deletions

View file

@ -1,2 +1,2 @@
async unsafe fn foo() {}
unsafe async fn foo() {}
unsafe const fn bar() {}

View file

@ -1,9 +1,9 @@
SOURCE_FILE@[0; 50)
ERROR@[0; 5)
ASYNC_KW@[0; 5) "async"
WHITESPACE@[5; 6) " "
FN_DEF@[6; 24)
UNSAFE_KW@[6; 12) "unsafe"
ERROR@[0; 6)
UNSAFE_KW@[0; 6) "unsafe"
WHITESPACE@[6; 7) " "
FN_DEF@[7; 24)
ASYNC_KW@[7; 12) "async"
WHITESPACE@[12; 13) " "
FN_KW@[13; 15) "fn"
WHITESPACE@[15; 16) " "
@ -37,5 +37,5 @@ SOURCE_FILE@[0; 50)
L_CURLY@[47; 48) "{"
R_CURLY@[48; 49) "}"
WHITESPACE@[49; 50) "\n"
error 5: expected existential, fn, trait or impl
error 6: expected existential, fn, trait or impl
error 31: expected existential, fn, trait or impl

View file

@ -1,2 +1,2 @@
unsafe async fn foo() {}
async unsafe fn foo() {}
const unsafe fn bar() {}

View file

@ -1,8 +1,8 @@
SOURCE_FILE@[0; 50)
FN_DEF@[0; 24)
UNSAFE_KW@[0; 6) "unsafe"
WHITESPACE@[6; 7) " "
ASYNC_KW@[7; 12) "async"
ASYNC_KW@[0; 5) "async"
WHITESPACE@[5; 6) " "
UNSAFE_KW@[6; 12) "unsafe"
WHITESPACE@[12; 13) " "
FN_KW@[13; 15) "fn"
WHITESPACE@[15; 16) " "