Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse impl const Trait #7338

Merged
merged 1 commit into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions crates/parser/src/grammar/items/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ pub(super) fn impl_(p: &mut Parser) {
type_params::opt_generic_param_list(p);
}

// test impl_def_const
// impl const Send for X {}
p.eat(T![const]);

// FIXME: never type
// impl ! {}

Expand Down
24 changes: 24 additions & 0 deletions crates/syntax/test_data/parser/inline/ok/0161_impl_def_const.rast
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
SOURCE_FILE@0..25
IMPL@0..24
IMPL_KW@0..4 "impl"
WHITESPACE@4..5 " "
CONST_KW@5..10 "const"
WHITESPACE@10..11 " "
PATH_TYPE@11..15
PATH@11..15
PATH_SEGMENT@11..15
NAME_REF@11..15
IDENT@11..15 "Send"
WHITESPACE@15..16 " "
FOR_KW@16..19 "for"
WHITESPACE@19..20 " "
PATH_TYPE@20..21
PATH@20..21
PATH_SEGMENT@20..21
NAME_REF@20..21
IDENT@20..21 "X"
WHITESPACE@21..22 " "
ASSOC_ITEM_LIST@22..24
L_CURLY@22..23 "{"
R_CURLY@23..24 "}"
WHITESPACE@24..25 "\n"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
impl const Send for X {}