internal: fix bugs in tests by simplifying code
This commit is contained in:
@@ -194,10 +194,12 @@ fn opt_visibility(p: &mut Parser) -> bool {
|
||||
// crate fn main() { }
|
||||
// struct S { crate field: u32 }
|
||||
// struct T(crate u32);
|
||||
//
|
||||
// test crate_keyword_path
|
||||
// fn foo() { crate::foo(); }
|
||||
T![crate] if !p.nth_at(1, T![::]) => {
|
||||
T![crate] => {
|
||||
if p.nth_at(1, T![::]) {
|
||||
// test crate_keyword_path
|
||||
// fn foo() { crate::foo(); }
|
||||
return false;
|
||||
}
|
||||
let m = p.start();
|
||||
p.bump(T![crate]);
|
||||
m.complete(p, VISIBILITY);
|
||||
|
||||
@@ -374,7 +374,6 @@ fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)>
|
||||
// let mut p = F{x: 5};
|
||||
// {p}.x = 10;
|
||||
// }
|
||||
//
|
||||
let (lhs, blocklike) = atom::atom_expr(p, r)?;
|
||||
return Some(postfix_expr(p, lhs, blocklike, !(r.prefer_stmt && blocklike.is_block())));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user