diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /servo/components/style/gecko/wrapper.rs | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'servo/components/style/gecko/wrapper.rs')
-rw-r--r-- | servo/components/style/gecko/wrapper.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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<GeckoNode<'a>>), /// A Gecko-implemented iterator we need to drop appropriately. - GeckoIterator(structs::StyleChildrenIterator), + GeckoIterator(std::mem::ManuallyDrop<structs::StyleChildrenIterator>), } 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::<structs::StyleChildrenIterator>::uninit(); + bindings::Gecko_ConstructStyleChildrenIterator(self.0, iter.as_mut_ptr()); + return LayoutIterator(GeckoChildrenIterator::GeckoIterator(std::mem::ManuallyDrop::new(iter.assume_init()))); } } |