aboutsummaryrefslogtreecommitdiff
path: root/crates/parser
diff options
context:
space:
mode:
authorArif Roktim <[email protected]>2020-10-23 07:06:04 +0100
committerArif Roktim <[email protected]>2020-10-24 07:20:45 +0100
commit0a9ff042709750d0e413c7a97bc6c4166d46a976 (patch)
tree3e48009455cf0314952dae08649b6e8f41605024 /crates/parser
parent8b3c851dd37f39f79e7e8807378f45fdde7f6411 (diff)
Don't interpret type path as part of visibility.
Diffstat (limited to 'crates/parser')
-rw-r--r--crates/parser/src/grammar.rs6
1 files changed, 5 insertions, 1 deletions
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 {
184 // pub(self) struct S; 184 // pub(self) struct S;
185 // pub(self) struct S; 185 // pub(self) struct S;
186 // pub(self) struct S; 186 // pub(self) struct S;
187 T![crate] | T![self] | T![super] => { 187
188 // test pub_parens_typepath
189 // struct B(pub (super::A));
190 // struct B(pub (crate::A,));
191 T![crate] | T![self] | T![super] if p.nth(2) != T![:] => {
188 p.bump_any(); 192 p.bump_any();
189 p.bump_any(); 193 p.bump_any();
190 p.expect(T![')']); 194 p.expect(T![')']);