Don't interpret type path as part of visibility.

This commit is contained in:
Arif Roktim 2020-10-23 02:06:04 -04:00
parent 8b3c851dd3
commit 0a9ff04270
3 changed files with 61 additions and 1 deletions

View file

@ -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![')']);