-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Threads with Arc<RefCell<T>> #21469
Comments
The error message from the compiler could be better. |
Oh yes, I figured it out, but the docs should probably be updated :) Edit: And yes, the error message is misleading. |
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Jan 21, 2015
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Jan 22, 2015
@Thiez Does |
@gobwas no, |
@eddyb 🍻 thanks ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried doing the following
Rust complains:
(Note that my code doesn't involve any
UnsafeCell
s at all)I was under the impression that, to get a shared mutable state, you wrapped a RefCell in an Arc. The docs even mention that "It's very common then to put a RefCell inside shared pointer types to reintroduce mutability", right after mentioning
Arc
as a smart shared pointer type. However, @eddyb mentioned on IRC that that might not be the case and suggested that it might be a documentation issue.The text was updated successfully, but these errors were encountered: