Files
servo/components/script/script_runtime.rs
Josh Matthews c62fbe7250 script: Add unsafe block in set_gc_zeal_options. (#41215)
Fixes the following warning:
```
warning[E0133]: call to unsafe function `js::jsapi::SetGCZeal` is unsafe and requires unsafe block
    --> components/script/script_runtime.rs:1144:5
     |
1144 |     SetGCZeal(cx, level, frequency);
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
     = note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
    --> components/script/script_runtime.rs:1132:1
     |
1132 | unsafe fn set_gc_zeal_options(cx: *mut RawJSContext) {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: `#[warn(unsafe_op_in_unsafe_fn)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
```

Testing: Build-time only.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-12-12 04:25:13 +00:00

56 KiB