-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Introduce slots; remove mutable boxes/vectors/record fields/object fields #856
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
So taking the value of a slot in a non-lvalue context would be an error?
|
Actually thinking through this more, slots have several weird issues relating to autoderef and generic functions. Talked this over with Dave and I think it makes sense to keep |
Dupe of issue #518. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 15, 2023
…acrum Update rustix to 0.38.19 addresses [rustix/rust-lang#856](bytecodealliance/rustix#856). Commands that do the update: `cargo +nightly update rustix` r? `@Mark-Simulacrum`
celinval
pushed a commit
to celinval/rust-dev
that referenced
this issue
Jun 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IIRC we agreed upon the notion of a "slot", which is a simple way to create a mutable interior value. This lets us abstract over the mutable and immutable vectors without the subtyping relation that "mutable?" introduces, which is painful (and which we never got right in the presence of generics).
So you could construct a slot using, say,
slot 3
, and that creates a mutable pseudo-box that is interior. Slots have no representation at the IR level; they're purely a way to help us enforce immutability restrictions.[mutable int]
would become[slot int]
,@mutable int
would become@slot int
, etc.This may be appropriate for the first milestone, depending on how serious we consider the type soundness hole with generics to be for 0.1.
The text was updated successfully, but these errors were encountered: