Closed
Description
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:
self.pending_line = Line::new(self.floats.writing_mode, &self.minimum_metrics);
or
let mut new_line = Line::new(self.floats.writing_mode, &self.minimum_metrics);
mem::swap(&mut self.pending_line, &mut new_line);
then self.pending
is updated as expected and Servo does not crash on Android.