Use workspace definitions for all crates and update to the 2021 edition (#32544)

This commit is contained in:
Martin Robinson 2024-06-18 11:22:08 +02:00 committed by GitHub
parent 42b09d483f
commit 4a7f3bac7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 283 additions and 268 deletions

View file

@ -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(),