From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- servo/components/style/gecko/wrapper.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'servo/components/style/gecko/wrapper.rs') diff --git a/servo/components/style/gecko/wrapper.rs b/servo/components/style/gecko/wrapper.rs index eab968149c..5e2d893b15 100644 --- a/servo/components/style/gecko/wrapper.rs +++ b/servo/components/style/gecko/wrapper.rs @@ -577,14 +577,14 @@ pub enum GeckoChildrenIterator<'a> { /// replaces it with the next sibling when requested. Current(Option>), /// A Gecko-implemented iterator we need to drop appropriately. - GeckoIterator(structs::StyleChildrenIterator), + GeckoIterator(std::mem::ManuallyDrop), } impl<'a> Drop for GeckoChildrenIterator<'a> { fn drop(&mut self) { if let GeckoChildrenIterator::GeckoIterator(ref mut it) = *self { unsafe { - bindings::Gecko_DestroyStyleChildrenIterator(it); + bindings::Gecko_DestroyStyleChildrenIterator(&mut **it); } } } @@ -605,7 +605,7 @@ impl<'a> Iterator for GeckoChildrenIterator<'a> { // however we can't express this easily with bindgen, and it would // introduce functions with two input lifetimes into bindgen, // which would be out of scope for elision. - bindings::Gecko_GetNextStyleChild(&mut *(it as *mut _)) + bindings::Gecko_GetNextStyleChild(&mut **it) .as_ref() .map(GeckoNode) }, @@ -1015,9 +1015,9 @@ impl<'le> TElement for GeckoElement<'le> { self.may_have_anonymous_children() { unsafe { - let mut iter: structs::StyleChildrenIterator = ::std::mem::zeroed(); - bindings::Gecko_ConstructStyleChildrenIterator(self.0, &mut iter); - return LayoutIterator(GeckoChildrenIterator::GeckoIterator(iter)); + let mut iter = std::mem::MaybeUninit::::uninit(); + bindings::Gecko_ConstructStyleChildrenIterator(self.0, iter.as_mut_ptr()); + return LayoutIterator(GeckoChildrenIterator::GeckoIterator(std::mem::ManuallyDrop::new(iter.assume_init()))); } } -- cgit v1.2.3