Skip to content

Commit 0a9ff04

Browse files
committed
Don't interpret type path as part of visibility.
1 parent 8b3c851 commit 0a9ff04

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

crates/parser/src/grammar.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ fn opt_visibility(p: &mut Parser) -> bool {
184184
// pub(self) struct S;
185185
// pub(self) struct S;
186186
// 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![:] => {
188192
p.bump_any();
189193
p.bump_any();
190194
p.expect(T![')']);
Lines changed: 54 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
struct B(pub (super::A));
2+
struct B(pub (crate::A,));

0 commit comments

Comments
 (0)