-
Notifications
You must be signed in to change notification settings - Fork 13.3k
mem::replace don't actually mutate the destination on Android #49282
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
Comments
The following also works: mem::replace(&mut self.pending_line,
Line::new(self.floats.writing_mode, &self.minimum_metrics));
mem::replace(&mut self.pending_line,
Line::new(self.floats.writing_mode, &self.minimum_metrics)); (yes, performing the same operation twice) |
Hmm, it looks like that type is pretty large (https://github.com/jdm/servo/blob/layoutstuff/components/layout/inline.rs#L221-L245) so will be hitting the simd path in swap (https://github.com/rust-lang/rust/blob/master/src/libcore/ptr.rs#L194-L227) that's currently disabled on some other platforms, so I wonder if the bug's in there somewhere... |
Triage: Not sure if this is still an issue. Updated libcore SIMD code: Lines 418 to 465 in 8ce3f84
|
Realistically I don't think there's any point to leaving this open. We never tried to make a minimal reproduction, and nobody else has stumbled across this issue in the intervening five years. |
Agreed; the implementation of rust/library/core/src/mem/mod.rs Lines 908 to 912 in 70adb4e
|
I have a branch of Servo which crashes when run on Android because a key use of mem::replace does not actually cause the destination to change values. When I add
println!("{:?}", self.pending_line)
before and after the mem::replace, on desktop the values are updated as expected, but on Android the original value remains.When I use either of the following instead:
or
then
self.pending
is updated as expected and Servo does not crash on Android.The text was updated successfully, but these errors were encountered: