Skip to content
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
11 changes: 6 additions & 5 deletions crates/parser/src/grammar/items/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ pub(super) fn impl_(p: &mut Parser<'_>, m: Marker) {
// impl const Send for S {}
p.eat(T![const]);

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

// test impl_item_neg
// impl !Send for S {}
p.eat(T![!]);
if p.at(T![!]) && !p.nth_at(1, T!['{']) {
// test impl_item_neg
// impl !Send for S {}
p.eat(T![!]);
}
impl_type(p);
if p.eat(T![for]) {
impl_type(p);
Expand Down
4 changes: 4 additions & 0 deletions crates/parser/test_data/generated/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ mod ok {
#[test]
fn impl_item_neg() { run_and_expect_no_errors("test_data/parser/inline/ok/impl_item_neg.rs"); }
#[test]
fn impl_item_never_type() {
run_and_expect_no_errors("test_data/parser/inline/ok/impl_item_never_type.rs");
}
#[test]
fn impl_trait_type() {
run_and_expect_no_errors("test_data/parser/inline/ok/impl_trait_type.rs");
}
Expand Down
11 changes: 11 additions & 0 deletions crates/parser/test_data/parser/inline/ok/impl_item_never_type.rast
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SOURCE_FILE
IMPL
IMPL_KW "impl"
WHITESPACE " "
NEVER_TYPE
BANG "!"
WHITESPACE " "
ASSOC_ITEM_LIST
L_CURLY "{"
R_CURLY "}"
WHITESPACE "\n"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
impl ! {}