aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/tests/data/parser/inline/err
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-04-03 16:33:58 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-04-03 16:33:58 +0100
commit84d8665e13007b0ee27e2a42ff74db815923cdce (patch)
treef60577c56dc805a54683359ecc6f2e08575fd65e /crates/ra_syntax/tests/data/parser/inline/err
parentf1ac9c8f558832f260bdd8b998fb1d7fbbcb6db5 (diff)
parent636270f4a4f80f5d24571147bcadfbeaa29310a0 (diff)
Merge #1101
1101: Parse unsafe async / const unsafe fns properly r=matklad a=robojumper Also adds tests that `unsafe async fn` as well as `const unsafe fn` parse properly and that these keywords in the reversed order cause parse errors. [Playground link to verify that this is the correct order.](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=7850b8d92579de31c38f835f76afa4ce) Closes #1086. Co-authored-by: robojumper <[email protected]>
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/inline/err')
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.rs2
-rw-r--r--crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt39
2 files changed, 41 insertions, 0 deletions
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 @@
1async unsafe fn foo() {}
2unsafe 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 @@
1SOURCE_FILE@[0; 50)
2 ERROR@[0; 5)
3 ASYNC_KW@[0; 5) "async"
4 err: `expected fn, trait or impl`
5 WHITESPACE@[5; 6) " "
6 FN_DEF@[6; 24)
7 UNSAFE_KW@[6; 12) "unsafe"
8 WHITESPACE@[12; 13) " "
9 FN_KW@[13; 15) "fn"
10 WHITESPACE@[15; 16) " "
11 NAME@[16; 19)
12 IDENT@[16; 19) "foo"
13 PARAM_LIST@[19; 21)
14 L_PAREN@[19; 20) "("
15 R_PAREN@[20; 21) ")"
16 WHITESPACE@[21; 22) " "
17 BLOCK@[22; 24)
18 L_CURLY@[22; 23) "{"
19 R_CURLY@[23; 24) "}"
20 WHITESPACE@[24; 25) "\n"
21 ERROR@[25; 31)
22 UNSAFE_KW@[25; 31) "unsafe"
23 err: `expected fn, trait or impl`
24 WHITESPACE@[31; 32) " "
25 FN_DEF@[32; 49)
26 CONST_KW@[32; 37) "const"
27 WHITESPACE@[37; 38) " "
28 FN_KW@[38; 40) "fn"
29 WHITESPACE@[40; 41) " "
30 NAME@[41; 44)
31 IDENT@[41; 44) "bar"
32 PARAM_LIST@[44; 46)
33 L_PAREN@[44; 45) "("
34 R_PAREN@[45; 46) ")"
35 WHITESPACE@[46; 47) " "
36 BLOCK@[47; 49)
37 L_CURLY@[47; 48) "{"
38 R_CURLY@[48; 49) "}"
39 WHITESPACE@[49; 50) "\n"