mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-04-08 21:05:28 +00:00
Merge pull request #20972 from A4-Tacks/impl-never-type
Fix not parse never type in inherent impl
This commit is contained in:
committed by
Laurențiu Nicola
parent
95a0b20dad
commit
ca83ff37d7
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
SOURCE_FILE
|
||||
IMPL
|
||||
IMPL_KW "impl"
|
||||
WHITESPACE " "
|
||||
NEVER_TYPE
|
||||
BANG "!"
|
||||
WHITESPACE " "
|
||||
ASSOC_ITEM_LIST
|
||||
L_CURLY "{"
|
||||
R_CURLY "}"
|
||||
WHITESPACE "\n"
|
||||
@@ -0,0 +1 @@
|
||||
impl ! {}
|
||||
Reference in New Issue
Block a user