-
Notifications
You must be signed in to change notification settings - Fork 58
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
Is it sound to field-project into a Cell
or UnsafeCell
?
#451
Comments
This is intended to be sound for tuples and structs, yes. We have a function safely exposing this for slices, but Rust cannot express this for tuples or structs. It is clearly not sound for enums. |
That said, there is rust-lang/rust#80778, so currently this might actually not be sound. EDIT: Ah no structs and tuples are still fine. It's arrays where there is a problem. |
Thanks for the breadcrumbs! |
Now that rust-lang/rust#114795 has landed, is this guaranteed to be sound? |
That is definitely my intention, yes. But ultimately this needs a T-libs-abi guarantee. |
Given a
&Cell<T>
or&UnsafeCell<T>
, is it sound to produce a&Cell<F>
or&UnsafeCell<F>
to a field within the original (assuming that lifetimes are respected etc etc)? E.g.:The text was updated successfully, but these errors were encountered: