From 636270f4a4f80f5d24571147bcadfbeaa29310a0 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 3 Apr 2019 17:11:56 +0200 Subject: Parse unsafe async / const unsafe fns properly --- .../data/parser/inline/err/0010_wrong_order_fns.rs | 2 ++ .../parser/inline/err/0010_wrong_order_fns.txt | 39 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.rs create mode 100644 crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt (limited to 'crates/ra_syntax/tests/data/parser/inline/err') diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.rs b/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.rs new file mode 100644 index 000000000..16edee95d --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.rs @@ -0,0 +1,2 @@ +async unsafe fn foo() {} +unsafe const fn bar() {} diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt b/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt new file mode 100644 index 000000000..220191ffa --- /dev/null +++ b/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt @@ -0,0 +1,39 @@ +SOURCE_FILE@[0; 50) + ERROR@[0; 5) + ASYNC_KW@[0; 5) "async" + err: `expected fn, trait or impl` + WHITESPACE@[5; 6) " " + FN_DEF@[6; 24) + UNSAFE_KW@[6; 12) "unsafe" + WHITESPACE@[12; 13) " " + FN_KW@[13; 15) "fn" + WHITESPACE@[15; 16) " " + NAME@[16; 19) + IDENT@[16; 19) "foo" + PARAM_LIST@[19; 21) + L_PAREN@[19; 20) "(" + R_PAREN@[20; 21) ")" + WHITESPACE@[21; 22) " " + BLOCK@[22; 24) + L_CURLY@[22; 23) "{" + R_CURLY@[23; 24) "}" + WHITESPACE@[24; 25) "\n" + ERROR@[25; 31) + UNSAFE_KW@[25; 31) "unsafe" + err: `expected fn, trait or impl` + WHITESPACE@[31; 32) " " + FN_DEF@[32; 49) + CONST_KW@[32; 37) "const" + WHITESPACE@[37; 38) " " + FN_KW@[38; 40) "fn" + WHITESPACE@[40; 41) " " + NAME@[41; 44) + IDENT@[41; 44) "bar" + PARAM_LIST@[44; 46) + L_PAREN@[44; 45) "(" + R_PAREN@[45; 46) ")" + WHITESPACE@[46; 47) " " + BLOCK@[47; 49) + L_CURLY@[47; 48) "{" + R_CURLY@[48; 49) "}" + WHITESPACE@[49; 50) "\n" -- cgit v1.2.3