Skip to content
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

Introduce slots; remove mutable boxes/vectors/record fields/object fields #856

Closed
pcwalton opened this issue Aug 21, 2011 · 3 comments
Closed

Comments

@pcwalton
Copy link
Contributor

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.

@marijnh
Copy link
Contributor

marijnh commented Aug 22, 2011

So taking the value of a slot in a non-lvalue context would be an error?

let x = slot int;
f(x);

@pcwalton
Copy link
Contributor Author

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 mutable?, but to fix the issue with covariance/invariance and rename it to something a little less gross (const maybe?)

@pcwalton
Copy link
Contributor Author

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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants