991: Use Marker argument for item parsers r=matklad a=pcpthm

Before doing this for expressions, I found that the pattern (Marker argument) should be applied to the item parsers because visiblity and modifiers are parsed in a separate function.

Fixed some parser bugs:
- Fix pub_expr: `pub 42;` was allowed.
- Fix incorrect parsing of crate::path: incorrectly parsed as `crate` as a visibility.

Co-authored-by: pcpthm <pcpthm@gmail.com>
This commit is contained in:
bors[bot] 2019-03-18 09:32:28 +00:00
commit 1cd18f9237
14 changed files with 149 additions and 81 deletions

View file

@ -67,8 +67,6 @@ pub(crate) fn expr_block_contents(p: &mut Parser) {
Err(m) => m,
};
// test pub_expr
// fn foo() { pub 92; } //FIXME
if has_attrs {
m.abandon(p);
p.error("expected a let statement or an item after attributes in block");