-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
'as', '<' and '*' can cause a parsing error #32852
Comments
Thinking about this a bit further, the 'bare raw pointers' error must be occurring very early in the parsing (lexer?) in order to trigger that early. The less-than doesn't even have a matching angle-bracket. |
The parser expects a type after The specialized error message about bare raw pointers should probably be removed - it's a pre-1.0 feature and only gray-bearded elders remember about them. |
Closing in favor of #22644. |
The following code snippet is causing an error that might be avoidable (I suspect a parsing error, but I don't know how the grammar is actually defined, so this is just a guess). The error is "bare raw pointers are no longer allowed".
fn main() { let a = &4u64; println!("{}", 43 as u64 < *a);
I suspect that the *a is being interpreted as the start of a type generic, when it's actually dereferencing a value. Adding brances '( ... )' fixes the issue, as well as reordering the statement into a '>'. The problem occurs on both stable and nightly.
The text was updated successfully, but these errors were encountered: