From 0a9ff042709750d0e413c7a97bc6c4166d46a976 Mon Sep 17 00:00:00 2001 From: Arif Roktim Date: Fri, 23 Oct 2020 02:06:04 -0400 Subject: Don't interpret type path as part of visibility. --- crates/parser/src/grammar.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/parser/src/grammar.rs') diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index 562e92252..4ab206a83 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs @@ -184,7 +184,11 @@ fn opt_visibility(p: &mut Parser) -> bool { // pub(self) struct S; // pub(self) struct S; // pub(self) struct S; - T![crate] | T![self] | T![super] => { + + // test pub_parens_typepath + // struct B(pub (super::A)); + // struct B(pub (crate::A,)); + T![crate] | T![self] | T![super] if p.nth(2) != T![:] => { p.bump_any(); p.bump_any(); p.expect(T![')']); -- cgit v1.2.3