-
Notifications
You must be signed in to change notification settings - Fork 13.3k
pprust::print_if does not anticipate evil #652
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
Comments
You'll get that in several other places. Our ast structure accepts only those two forms in that position. Though other things are representable, they aren't proper rust asts. |
Maybe a |
I'd recommend rigging the fuzzer to simply not output such ASTs. You probably already have similar code to ensure only lvalues are output as the lhs of assign/move expressions. |
How about just adding a constraint to the AST? We have refinement types after all (or are supposed to) :) |
Yeah, we should start adding constraints where it makes sense |
Will that change the fold signature, or will it make fold do a check/fail? |
It will make it impossible to construct an expr_if that contains the wrong kind of else expression. I think in practice the code that wants to do such a think would be forced to do an
|
I realize that that didn't actually answer your question. I don't think it would change the fold signature, but would change the code that uses the fold. |
We don't have constrained types, so "add a constraint to the AST" won't work yet. It's my next to-do, though! |
(Assigning to myself so I can use this as a test case for constrained types once they're implemented) |
Not relevant as of commit 41a21f0, which removed current incarnation of typestate. |
Clean up CI configuration and add s390x We can't test s390x because qemu segfaults but we can at least verify that it compiles. Closes rust-lang#650
Correct errors in the reference of extern functions definitions and declarations
…4_25_2 Sync from rust 2025/04/25
If my fuzzer replaces the 'els' node with something other than an expr_if or expr_block, I get:
upcall fail 'non-exhaustive match failure', ../src/comp/syntax/print/pprust.rs:636
The text was updated successfully, but these errors were encountered: