summaryrefslogtreecommitdiffstats
path: root/servo/components/style/gecko/wrapper.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /servo/components/style/gecko/wrapper.rs
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/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.rs12
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())));
}
}