Environment
Rust: 1.46.0
OS: Ubuntu 20.04 under WSL 2.
Issue
I tried to run the tests as described in development guide (basically, installed dependencies and ran cargo test --all).
However, compilation failed with the following errors:
error[E0277]: `*mut u8` cannot be shared between threads safely
--> wasm/lib/src/browser_module.rs:165:6
|
165 | impl PyValue for PyPromise {
| ^^^^^^^ `*mut u8` cannot be shared between threads safely
|
= help: within `browser_module::PyPromise`, the trait `std::marker::Sync` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `js_sys::Promise`
= note: required because it appears within the type `browser_module::PyPromise`
error[E0277]: `*mut u8` cannot be sent between threads safely
--> wasm/lib/src/browser_module.rs:165:6
|
165 | impl PyValue for PyPromise {
| ^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: within `browser_module::PyPromise`, the trait `std::marker::Send` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `js_sys::Promise`
= note: required because it appears within the type `browser_module::PyPromise`
error[E0277]: `*mut u8` cannot be shared between threads safely
--> wasm/lib/src/browser_module.rs:261:6
|
261 | impl PyValue for Document {
| ^^^^^^^ `*mut u8` cannot be shared between threads safely
|
= help: within `browser_module::Document`, the trait `std::marker::Sync` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Document`
= note: required because it appears within the type `browser_module::Document`
error[E0277]: `*mut u8` cannot be sent between threads safely
--> wasm/lib/src/browser_module.rs:261:6
|
261 | impl PyValue for Document {
| ^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: within `browser_module::Document`, the trait `std::marker::Send` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Document`
= note: required because it appears within the type `browser_module::Document`
error[E0277]: `*mut u8` cannot be shared between threads safely
--> wasm/lib/src/browser_module.rs:287:6
|
287 | impl PyValue for Element {
| ^^^^^^^ `*mut u8` cannot be shared between threads safely
|
= help: within `browser_module::Element`, the trait `std::marker::Sync` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Element`
= note: required because it appears within the type `browser_module::Element`
error[E0277]: `*mut u8` cannot be sent between threads safely
--> wasm/lib/src/browser_module.rs:287:6
|
287 | impl PyValue for Element {
| ^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: within `browser_module::Element`, the trait `std::marker::Send` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Element`
= note: required because it appears within the type `browser_module::Element`
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustpython_wasm`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0277]: `*mut u8` cannot be shared between threads safely
--> wasm/lib/src/browser_module.rs:165:6
|
165 | impl PyValue for PyPromise {
| ^^^^^^^ `*mut u8` cannot be shared between threads safely
|
= help: within `browser_module::PyPromise`, the trait `std::marker::Sync` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `js_sys::Promise`
= note: required because it appears within the type `browser_module::PyPromise`
error[E0277]: `*mut u8` cannot be sent between threads safely
--> wasm/lib/src/browser_module.rs:165:6
|
165 | impl PyValue for PyPromise {
| ^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: within `browser_module::PyPromise`, the trait `std::marker::Send` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `js_sys::Promise`
= note: required because it appears within the type `browser_module::PyPromise`
error[E0277]: `*mut u8` cannot be shared between threads safely
--> wasm/lib/src/browser_module.rs:261:6
|
261 | impl PyValue for Document {
| ^^^^^^^ `*mut u8` cannot be shared between threads safely
|
= help: within `browser_module::Document`, the trait `std::marker::Sync` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Document`
= note: required because it appears within the type `browser_module::Document`
error[E0277]: `*mut u8` cannot be sent between threads safely
--> wasm/lib/src/browser_module.rs:261:6
|
261 | impl PyValue for Document {
| ^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: within `browser_module::Document`, the trait `std::marker::Send` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Document`
= note: required because it appears within the type `browser_module::Document`
error[E0277]: `*mut u8` cannot be shared between threads safely
--> wasm/lib/src/browser_module.rs:287:6
|
287 | impl PyValue for Element {
| ^^^^^^^ `*mut u8` cannot be shared between threads safely
|
= help: within `browser_module::Element`, the trait `std::marker::Sync` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Element`
= note: required because it appears within the type `browser_module::Element`
error[E0277]: `*mut u8` cannot be sent between threads safely
--> wasm/lib/src/browser_module.rs:287:6
|
287 | impl PyValue for Element {
| ^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: within `browser_module::Element`, the trait `std::marker::Send` is not implemented for `*mut u8`
= note: required because it appears within the type `std::marker::PhantomData<*mut u8>`
= note: required because it appears within the type `wasm_bindgen::JsValue`
= note: required because it appears within the type `js_sys::Object`
= note: required because it appears within the type `web_sys::EventTarget`
= note: required because it appears within the type `web_sys::Node`
= note: required because it appears within the type `web_sys::Element`
= note: required because it appears within the type `browser_module::Element`
error: aborting due to 6 previous errors
Environment
Rust: 1.46.0
OS: Ubuntu 20.04 under WSL 2.
Issue
I tried to run the tests as described in development guide (basically, installed dependencies and ran
cargo test --all).However, compilation failed with the following errors: