-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix immediate rvalues #9902
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix immediate rvalues #9902
Conversation
/// An atomically reference counted pointer. | ||
/// | ||
/// Enforces no shared-memory safety. | ||
#[cfg(not(stage0), not(stage1))] | ||
pub struct UnsafeArc<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this want the #[unsafe_no_drop_flag]
back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops :)
I can't see a way around doing this, but it seems like it was intended for this to be unnecessary. |
cc @metajack - this probably fixes the servo bug |
This makes me a bit nervous. I don't understand what you mean by "a reference cannot alter the value in a way the destructor will observe". The change to ensure zeroable memory was there for a reason, though -- I have to refresh my memory of the precise details. |
(Also, as an aside, I have a complete overhaul of the cleanup code bitrotting away on my branch for #3511 -- not that this should stop you from landing this patch) |
OK, I think I see what's going on now. The fix seems not unreasonable. r+ from me pending a better comment. |
This didn't end up fixing the actual issue with |
The code generation previously assumed a reference could not alter the value in a way the destructor would notice. This is an incorrect assumption for `&mut`, and is also incorrect for an `&` pointer to a non-`Freeze` type. Closes #7972
The code generation previously assumed a reference could not alter the value in a way the destructor would notice. This is an incorrect assumption for `&mut`, and is also incorrect for an `&` pointer to a non-`Freeze` type. Closes #7972
The code generation previously assumed a reference could not alter the
value in a way the destructor would notice. This is an incorrect
assumption for
&mut
, and is also incorrect for an&
pointer to anon-
Freeze
type.Closes #7972