-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ambiguity between type ascription and absolute paths #64242
Comments
сс @rust-lang/wg-grammar |
I was aware of this, but never planned making a fix due to low priority. |
According to libsyntax (
A path cannot end with
Unless I'm missing something fundamental here, the same issue as above applies and this should remain an error. |
@Centril I think you are trying to read this as I've checked with syn, and it parses the first example but not the second one. |
Yeah, that's exactly how I found this. My fear here though is that a genuine ambiguity might lurk in there... |
Oh I see. What's the ambiguity referenced in the title then? |
@Centril that was a non-formal use of the word, in a sense that rustc's parser can confuse the two. I am almost sure that there's no ambiguity on the grammar level here with tokens-with-jointness model, but I want to double check |
@matklad I see. For now, I think it would be good to add a test documenting the current behavior to prevent accidents. |
After #130673, the parser now recovers from |
I am not sure, but I think the following program should be valid:
It currently fails with
because we don't try to decompose
::
token.I am not sure what should be the behavior of
but I lean towards allowing it as well, looks like it requires only constant look-ahead to handle.
Anyway,
rg ':::' --type rust
shows that we don't have a test here.@petrochenkov what are your thoughts on this?
The text was updated successfully, but these errors were encountered: