mirror of
https://github.com/servo/servo.git
synced 2025-07-18 21:03:45 +01:00
script: Wrapping unsafe code in unsafe
blocks for basic DOM types (#37997)
There is a new default cargo clippy lint, `unsafe_op_in_unsafe_fn`, which requires unsafe code to be wrapped in unsafe blocks, even inside functions marked as unsafe. The lint is disabled as much of our code doesn't fulfill this contract. The thing itself is pretty useful in order to gradually remove unsafety, so this change starts adding `unsafe` blocks so we can eventually enable this lint. Testing: This doesn't change behavior so existings tests should suffice. Fixes: This is part of #35955. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
a13cc1b25a
commit
2366a8bf9e
6 changed files with 51 additions and 30 deletions
|
@ -179,7 +179,7 @@ pub(crate) fn with_script_thread<R: Default>(f: impl FnOnce(&ScriptThread) -> R)
|
|||
pub(crate) unsafe fn trace_thread(tr: *mut JSTracer) {
|
||||
with_script_thread(|script_thread| {
|
||||
trace!("tracing fields of ScriptThread");
|
||||
script_thread.trace(tr);
|
||||
unsafe { script_thread.trace(tr) };
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue