mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-27 16:07:46 +00:00
Fix not parse never type in inherent impl
This commit is contained in:
parent
c46279da2f
commit
e92e6792cf
@ -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 ! {}
|
||||
Loading…
x
Reference in New Issue
Block a user