diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-06-18 11:22:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-18 09:22:08 +0000 |
commit | 4a7f3bac7cadff129d15e3b0a6471a7ed3c4aaa4 (patch) | |
tree | ac47671f7487383aa11f9a3f2e531e9ee34e50a6 /components/script/dom/htmlscriptelement.rs | |
parent | 42b09d483fbcc79345844d34b88b3ff4ae7a9735 (diff) | |
download | servo-4a7f3bac7cadff129d15e3b0a6471a7ed3c4aaa4.tar.gz servo-4a7f3bac7cadff129d15e3b0a6471a7ed3c4aaa4.zip |
Use workspace definitions for all crates and update to the 2021 edition (#32544)
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r-- | components/script/dom/htmlscriptelement.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index e0563f91bf3..f18c827fcfa 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -116,8 +116,12 @@ unsafe extern "C" fn off_thread_compilation_callback( let cx = GlobalScope::get_cx(); let _ar = enter_realm(&*global); - let compiled_script = FinishOffThreadStencil(*cx, token.0, ptr::null_mut()); + // TODO: This is necessary because the rust compiler will otherwise try to move the *mut + // OffThreadToken directly, which isn't marked as Send. The correct fix is that this + // type is marked as Send in mozjs. + let used_token = token; + let compiled_script = FinishOffThreadStencil(*cx, used_token.0, ptr::null_mut()); let load = if compiled_script.is_null() { Err(NoTrace(NetworkError::Internal( "Off-thread compilation failed.".into(), |