-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Classes: handle typestate correctly in ctors #2293
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
Milestone
Comments
Blocked on #2376 -- if that RFC gets accepted, we'll be able to eliminate ctors and there'll be no need for special cases in typestate. |
this is implemented in the new liveness code. if I'd realized it wasn't implemented at all in typestate I probably wouldn't have bothered, but oh well. =) |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 22, 2022
make -Zmiri-env-forward take precedence over -Zmiri-env-exclude Lets people experiment with the `TERM` env var.
celinval
added a commit
to celinval/rust-dev
that referenced
this issue
Jun 4, 2024
Use the overflow result operations instead of doing the math twice. This is related to the performance degradation we are seeing in the toolchain upgrade: rust-lang#2293 Co-authored-by: Michael Tautschnig <[email protected]>
jieyouxu
pushed a commit
to jieyouxu/rust
that referenced
this issue
Mar 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enforce these invariants in typestate:
"The constructor must initialize all fields of the object and cannot call any methods on self until it has done so." (currently there's no check that the ctor initializes fields, even)
"After calling a method on self, the constructor is not allowed to mutate any of its immutable fields."
The text was updated successfully, but these errors were encountered: