Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Matthews <[email protected]>
  • Loading branch information
jdm committed Dec 14, 2024
1 parent 50c4115 commit 116326d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion mozjs-sys/src/jsgc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ pub struct RootedBase {
// Annoyingly, bindgen can't cope with SM's use of templates, so we have to roll our own.
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "crown", allow(crown::unrooted_must_root_lint::allow_unrooted_interior))]
#[cfg_attr(
feature = "crown",
allow(crown::unrooted_must_root_lint::allow_unrooted_interior)
)]
pub struct Rooted<T: RootKind> {
pub vtable: T::Vtable,
pub base: RootedBase,
Expand Down
10 changes: 8 additions & 2 deletions mozjs/src/gc/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ unsafe impl<T: CustomTrace> CustomTrace for Vec<T> {
// This structure reimplements a C++ class that uses virtual dispatch, so
// use C layout to guarantee that vftable in CustomAutoRooter is in right place.
#[repr(C)]
#[cfg_attr(feature = "crown", allow(crown::unrooted_must_root_lint::allow_unrooted_interior))]
#[cfg_attr(
feature = "crown",
allow(crown::unrooted_must_root_lint::allow_unrooted_interior)
)]
pub struct CustomAutoRooter<T> {
_base: jsapi::CustomAutoRooter,
data: T,
Expand Down Expand Up @@ -115,7 +118,10 @@ impl<T: CustomTrace> CustomAutoRooter<T> {
/// DerefMut implementations.
/// This structure is created by `root` method on `CustomAutoRooter` or
/// by the `auto_root!` macro.
#[cfg_attr(feature = "crown", allow(crown::unrooted_must_root_lint::allow_unrooted_interior))]
#[cfg_attr(
feature = "crown",
allow(crown::unrooted_must_root_lint::allow_unrooted_interior)
)]
pub struct CustomAutoRooterGuard<'a, T: 'a + CustomTrace> {
rooter: &'a mut CustomAutoRooter<T>,
}
Expand Down
5 changes: 4 additions & 1 deletion mozjs/src/gc/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ use mozjs_sys::jsgc::ValueArray;
/// Rust API for keeping a Rooted value in the context's root stack.
/// Example usage: `rooted!(in(cx) let x = UndefinedValue());`.
/// `RootedGuard::new` also works, but the macro is preferred.
#[cfg_attr(feature = "crown", allow(crown::unrooted_must_root_lint::allow_unrooted_interior))]
#[cfg_attr(
feature = "crown",
allow(crown::unrooted_must_root_lint::allow_unrooted_interior)
)]
pub struct RootedGuard<'a, T: 'a + RootKind + Initialize> {
root: &'a mut Rooted<T>,
}
Expand Down

0 comments on commit 116326d

Please sign in to comment.