-
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
Unparenthesized expressions aren't allowed in casts #120
Comments
Both syntaxes are now invalid. You have two options: as lexemes "32u32 - 1u32", or as an expression "32-1 as u32". The "as" operator is low enough precedence that this doesn't require parens here. We currently do no constant propagation or folding (there was a parser hack that attempted to do negation-folding on constants, but it was really awful and I've removed it), so both versions involve runtime arithmetic. A clever version of the compiler will fold it all away (and/or LLVM may just do so automatically). |
Also note: if "1u32" makes your eyes hurt, it might be slightly less appalling if you make use of the underscores-in-numbers lexical treat at the suffix boundary: IOW write it as "1_u32". |
Update `cargo` and `crates-io` deps
add simd_fsqrt intrinsic
u32(32-1) does not compile whereas u32((32-1)). It would be nicer if the extra brackets were not needed.
The text was updated successfully, but these errors were encountered: