We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2087c35 commit f31cf84Copy full SHA for f31cf84
mozjs/src/gc/macros.rs
@@ -18,10 +18,12 @@ macro_rules! rooted {
18
};
19
(in($cx:expr) let $($var:ident)+: $type:ty) => {
20
let mut __root = $crate::jsapi::Rooted::new_unrooted();
21
+ // SAFETY:
22
+ // We're immediately storing the initial value in a rooted location.
23
let $($var)+: $crate::gc::RootedGuard<$type> = $crate::gc::RootedGuard::new(
24
$cx,
25
&mut __root,
- <$type as $crate::gc::GCMethods>::initial(),
26
+ unsafe { <$type as $crate::gc::GCMethods>::initial() },
27
);
28
29
}
0 commit comments