-
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
Typestate too strict for multi-var let #824
Comments
For simplicity, I actually prefer the current behavior. What's the static semantics of |
The (recently revised) resolver will reject this. Variables can no longer be used before they are initialized, and series of variables in a single let behave as if they are defined one after the other (i.e Common Lisp's let* form, not let). To do a name swap, you can do 'let (x, y) = (y, x);' (where x and y were previously bound). |
Ah, ok. As long as the resolver checks for obviously non-well-founded definitions, I guess I'm ok with implementing your original suggestion. |
Fixes and test for x86_64-unknown-linux-gnux32 This fixes all libc tests and almost all rustc tests (3 libstd tests and one run-pass test fails). Fixes rust-lang/libc#816
I'd like this to work:
Currently, the initializer for y is checked in an environment where neither variable has been defined, so typestate rejects this line.
The text was updated successfully, but these errors were encountered: