diff options
Diffstat (limited to 'crates/syntax/test_data/parser')
10 files changed, 137 insertions, 23 deletions
diff --git a/crates/syntax/test_data/parser/err/0047_mutable_const_item.rast b/crates/syntax/test_data/parser/err/0047_mutable_const_item.rast new file mode 100644 index 000000000..c7eb312c9 --- /dev/null +++ b/crates/syntax/test_data/parser/err/0047_mutable_const_item.rast | |||
@@ -0,0 +1,22 @@ | |||
1 | [email protected] | ||
2 | [email protected] | ||
3 | [email protected] "const" | ||
4 | [email protected] " " | ||
5 | [email protected] "mut" | ||
6 | [email protected] " " | ||
7 | [email protected] | ||
8 | [email protected] "FOO" | ||
9 | [email protected] ":" | ||
10 | [email protected] " " | ||
11 | [email protected] | ||
12 | [email protected] "(" | ||
13 | [email protected] ")" | ||
14 | [email protected] " " | ||
15 | [email protected] "=" | ||
16 | [email protected] " " | ||
17 | [email protected] | ||
18 | [email protected] "(" | ||
19 | [email protected] ")" | ||
20 | [email protected] ";" | ||
21 | [email protected] "\n" | ||
22 | error 6..9: const globals cannot be mutable | ||
diff --git a/crates/syntax/test_data/parser/err/0047_mutable_const_item.rs b/crates/syntax/test_data/parser/err/0047_mutable_const_item.rs new file mode 100644 index 000000000..b34336f3f --- /dev/null +++ b/crates/syntax/test_data/parser/err/0047_mutable_const_item.rs | |||
@@ -0,0 +1 @@ | |||
const mut FOO: () = (); | |||
diff --git a/crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rast b/crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rast new file mode 100644 index 000000000..dcd39535b --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rast | |||
@@ -0,0 +1,24 @@ | |||
1 | [email protected] | ||
2 | [email protected] | ||
3 | [email protected] "impl" | ||
4 | [email protected] " " | ||
5 | [email protected] "const" | ||
6 | [email protected] " " | ||
7 | [email protected] | ||
8 | [email protected] | ||
9 | [email protected] | ||
10 | [email protected] | ||
11 | [email protected] "Send" | ||
12 | [email protected] " " | ||
13 | [email protected] "for" | ||
14 | [email protected] " " | ||
15 | [email protected] | ||
16 | [email protected] | ||
17 | [email protected] | ||
18 | [email protected] | ||
19 | [email protected] "X" | ||
20 | [email protected] " " | ||
21 | [email protected] | ||
22 | [email protected] "{" | ||
23 | [email protected] "}" | ||
24 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rs b/crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rs new file mode 100644 index 000000000..8d6886469 --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rs | |||
@@ -0,0 +1 @@ | |||
impl const Send for X {} | |||
diff --git a/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast b/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast new file mode 100644 index 000000000..61c17333a --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast | |||
@@ -0,0 +1,42 @@ | |||
1 | [email protected] | ||
2 | [email protected] | ||
3 | [email protected] "impl" | ||
4 | [email protected] " " | ||
5 | [email protected] | ||
6 | [email protected] | ||
7 | [email protected] | ||
8 | [email protected] | ||
9 | [email protected] "T" | ||
10 | [email protected] " " | ||
11 | [email protected] "for" | ||
12 | [email protected] " " | ||
13 | [email protected] | ||
14 | [email protected] | ||
15 | [email protected] | ||
16 | [email protected] | ||
17 | [email protected] "Foo" | ||
18 | [email protected] " " | ||
19 | [email protected] | ||
20 | [email protected] "{" | ||
21 | [email protected] "\n " | ||
22 | [email protected] | ||
23 | [email protected] "default" | ||
24 | [email protected] " " | ||
25 | [email protected] "async" | ||
26 | [email protected] " " | ||
27 | [email protected] "unsafe" | ||
28 | [email protected] " " | ||
29 | [email protected] "fn" | ||
30 | [email protected] " " | ||
31 | [email protected] | ||
32 | [email protected] "foo" | ||
33 | [email protected] | ||
34 | [email protected] "(" | ||
35 | [email protected] ")" | ||
36 | [email protected] " " | ||
37 | [email protected] | ||
38 | [email protected] "{" | ||
39 | [email protected] "}" | ||
40 | [email protected] "\n" | ||
41 | [email protected] "}" | ||
42 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rs b/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rs new file mode 100644 index 000000000..05c20a68f --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | impl T for Foo { | ||
2 | default async unsafe fn foo() {} | ||
3 | } | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast b/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast new file mode 100644 index 000000000..9c43ccea5 --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast | |||
@@ -0,0 +1,40 @@ | |||
1 | [email protected] | ||
2 | [email protected] | ||
3 | [email protected] "impl" | ||
4 | [email protected] " " | ||
5 | [email protected] | ||
6 | [email protected] | ||
7 | [email protected] | ||
8 | [email protected] | ||
9 | [email protected] "T" | ||
10 | [email protected] " " | ||
11 | [email protected] "for" | ||
12 | [email protected] " " | ||
13 | [email protected] | ||
14 | [email protected] | ||
15 | [email protected] | ||
16 | [email protected] | ||
17 | [email protected] "Foo" | ||
18 | [email protected] " " | ||
19 | [email protected] | ||
20 | [email protected] "{" | ||
21 | [email protected] "\n " | ||
22 | [email protected] | ||
23 | [email protected] "default" | ||
24 | [email protected] " " | ||
25 | [email protected] "async" | ||
26 | [email protected] " " | ||
27 | [email protected] "fn" | ||
28 | [email protected] " " | ||
29 | [email protected] | ||
30 | [email protected] "foo" | ||
31 | [email protected] | ||
32 | [email protected] "(" | ||
33 | [email protected] ")" | ||
34 | [email protected] " " | ||
35 | [email protected] | ||
36 | [email protected] "{" | ||
37 | [email protected] "}" | ||
38 | [email protected] "\n" | ||
39 | [email protected] "}" | ||
40 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rs b/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rs new file mode 100644 index 000000000..78c3b4d85 --- /dev/null +++ b/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | impl T for Foo { | ||
2 | default async fn foo() {} | ||
3 | } | ||
diff --git a/crates/syntax/test_data/parser/ok/0024_const_item.rast b/crates/syntax/test_data/parser/ok/0024_const_item.rast index dd1b9c9a0..b89ed6f98 100644 --- a/crates/syntax/test_data/parser/ok/0024_const_item.rast +++ b/crates/syntax/test_data/parser/ok/0024_const_item.rast | |||
@@ -1,4 +1,4 @@ | |||
1 | SOURCE_FILE@0..64 | 1 | SOURCE_FILE@0..39 |
2 | [email protected] | 2 | [email protected] |
3 | [email protected] "const" | 3 | [email protected] "const" |
4 | [email protected] " " | 4 | [email protected] " " |
@@ -36,24 +36,3 @@ [email protected] | |||
36 | [email protected] "92" | 36 | [email protected] "92" |
37 | [email protected] ";" | 37 | [email protected] ";" |
38 | [email protected] "\n" | 38 | [email protected] "\n" |
39 | [email protected] | ||
40 | [email protected] "const" | ||
41 | [email protected] " " | ||
42 | [email protected] "mut" | ||
43 | [email protected] " " | ||
44 | [email protected] | ||
45 | [email protected] "BAR" | ||
46 | [email protected] ":" | ||
47 | [email protected] " " | ||
48 | [email protected] | ||
49 | [email protected] | ||
50 | [email protected] | ||
51 | [email protected] | ||
52 | [email protected] "u32" | ||
53 | [email protected] " " | ||
54 | [email protected] "=" | ||
55 | [email protected] " " | ||
56 | [email protected] | ||
57 | [email protected] "62" | ||
58 | [email protected] ";" | ||
59 | [email protected] "\n" | ||
diff --git a/crates/syntax/test_data/parser/ok/0024_const_item.rs b/crates/syntax/test_data/parser/ok/0024_const_item.rs index a806a209d..1f2ffa0da 100644 --- a/crates/syntax/test_data/parser/ok/0024_const_item.rs +++ b/crates/syntax/test_data/parser/ok/0024_const_item.rs | |||
@@ -1,3 +1,2 @@ | |||
1 | const _: u32 = 0; | 1 | const _: u32 = 0; |
2 | const FOO: u32 = 92; | 2 | const FOO: u32 = 92; |
3 | const mut BAR: u32 = 62; | ||