diff options
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | crates/parser/src/grammar/items/traits.rs | 4 | ||||
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rast | 24 | ||||
-rw-r--r-- | crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rs | 1 |
4 files changed, 31 insertions, 2 deletions
diff --git a/Cargo.lock b/Cargo.lock index aac473191..eafec00d3 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -1839,9 +1839,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" | |||
1839 | 1839 | ||
1840 | [[package]] | 1840 | [[package]] |
1841 | name = "ungrammar" | 1841 | name = "ungrammar" |
1842 | version = "1.9.2" | 1842 | version = "1.9.3" |
1843 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1843 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1844 | checksum = "58a02e2041a872d56354e843e8e86e6b946fc8e7dc32982fcdc335e29eb4cc8b" | 1844 | checksum = "f5901372c0f3a6a1a9d880aef134c8eaf5e54409343637508c0a344270b42d7b" |
1845 | 1845 | ||
1846 | [[package]] | 1846 | [[package]] |
1847 | name = "unicase" | 1847 | name = "unicase" |
diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs index d076974ed..d3327271c 100644 --- a/crates/parser/src/grammar/items/traits.rs +++ b/crates/parser/src/grammar/items/traits.rs | |||
@@ -40,6 +40,10 @@ pub(super) fn impl_(p: &mut Parser) { | |||
40 | type_params::opt_generic_param_list(p); | 40 | type_params::opt_generic_param_list(p); |
41 | } | 41 | } |
42 | 42 | ||
43 | // test impl_def_const | ||
44 | // impl const Send for X {} | ||
45 | p.eat(T![const]); | ||
46 | |||
43 | // FIXME: never type | 47 | // FIXME: never type |
44 | // impl ! {} | 48 | // impl ! {} |
45 | 49 | ||
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 | SOURCE_FILE@0..25 | ||
2 | IMPL@0..24 | ||
3 | IMPL_KW@0..4 "impl" | ||
4 | WHITESPACE@4..5 " " | ||
5 | CONST_KW@5..10 "const" | ||
6 | WHITESPACE@10..11 " " | ||
7 | PATH_TYPE@11..15 | ||
8 | PATH@11..15 | ||
9 | PATH_SEGMENT@11..15 | ||
10 | NAME_REF@11..15 | ||
11 | IDENT@11..15 "Send" | ||
12 | WHITESPACE@15..16 " " | ||
13 | FOR_KW@16..19 "for" | ||
14 | WHITESPACE@19..20 " " | ||
15 | PATH_TYPE@20..21 | ||
16 | PATH@20..21 | ||
17 | PATH_SEGMENT@20..21 | ||
18 | NAME_REF@20..21 | ||
19 | IDENT@20..21 "X" | ||
20 | WHITESPACE@21..22 " " | ||
21 | ASSOC_ITEM_LIST@22..24 | ||
22 | L_CURLY@22..23 "{" | ||
23 | R_CURLY@23..24 "}" | ||
24 | WHITESPACE@24..25 "\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 {} | |||