aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-26 14:34:00 +0000
committerGitHub <[email protected]>2020-10-26 14:34:00 +0000
commita0f134686409161b5bbef47388db19b30e373c81 (patch)
treefd7a367110ac2e4a212d605fea65db782dc03142 /crates/parser/src
parent1a84cadc88e23fead7435384bfd986dc08081509 (diff)
parent66a1de7d2084a54c5c4b67eac9b94909e700f136 (diff)
Merge #6333
6333: Don't interpret type path as part of visibility. r=matklad a=ArifRoktim This closes #5902. I only check that the next token isn't equal to `T![:]`, instead of the next two not being equal to `T![::]`. Is that ok? Co-authored-by: Arif Roktim <[email protected]>
Diffstat (limited to 'crates/parser/src')
-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![')']);