parser: introduce parse_item_kind as central ItemInfo logic.
this also extracts macro item parsers.
This commit is contained in:
parent
511dfdb8b3
commit
73d5970cdc
3 changed files with 172 additions and 201 deletions
|
|
@ -1,3 +1,2 @@
|
|||
#![feature(pub_restricted)]
|
||||
|
||||
pub(crate) () fn foo() {} //~ unmatched visibility
|
||||
//~^ ERROR expected item, found `(`
|
||||
|
|
|
|||
|
|
@ -1,8 +1,16 @@
|
|||
error: unmatched visibility `pub`
|
||||
--> $DIR/pub-restricted-error-fn.rs:3:10
|
||||
--> $DIR/pub-restricted-error-fn.rs:1:1
|
||||
|
|
||||
LL | pub(crate) () fn foo() {}
|
||||
| ^
|
||||
| ^^^^^^^^^^ the unmatched visibility
|
||||
|
|
||||
= help: you likely meant to define an item, e.g., `pub fn foo() {}`
|
||||
|
||||
error: aborting due to previous error
|
||||
error: expected item, found `(`
|
||||
--> $DIR/pub-restricted-error-fn.rs:1:12
|
||||
|
|
||||
LL | pub(crate) () fn foo() {}
|
||||
| ^ expected item
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue