Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Building for wasm32-unknown-emscripten fails unless wasm-bindgen version is pinned

Đang mở Phù hợp với người mới
#5 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, wasm
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với Cargo.toml và tái hiện lỗi bằng cargo +nightly build --target wasm32-unknown-emscripten. Đọc cách sử dụng closure trong src/queue.rs quanh các dòng 24 và 79, sau đó xác minh việc phân giải dependency đối với phiên bản wasm-bindgen đã được báo cáo; được xem là hoàn tất khi quá trình build target hoàn thành thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

cargo +nightly build --target wasm32-unknown-emscripten fails with

error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
   --> src\queue.rs:79:30
    |
 79 |                 Closure::new(move |_| state.run_all())
    |                 ------------ ^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
    |                 |
    |                 required by a bound introduced by this call
    |
    = help: within `QueueState`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
note: required because it appears within the type `Cell<isize>`
   --> C:\Users\HeartofPhos\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\cell.rs:315:12
    |
315 | pub struct Cell<T: ?Sized> {
    |            ^^^^
note: required because it appears within the type `RefCell<VecDeque<singlethread::Job>>`
   --> C:\Users\HeartofPhos\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\cell.rs:852:12
    |
852 | pub struct RefCell<T: ?Sized> {
    |            ^^^^^^^
note: required because it appears within the type `QueueState`
   --> src\queue.rs:24:8
    |
 24 | struct QueueState {
    |        ^^^^^^^^^^
    = note: required for `Rc<QueueState>` to implement `UnwindSafe`
note: required because `state` is used within this closure
   --> src\queue.rs:79:39
    |
 79 |                 Closure::new(move |_| state.run_all())
    |                                       ^^^^^
    = note: required for `{closure@src\queue.rs:79:30: 79:38}` to implement `wasm_bindgen::__rt::marker::MaybeUnwindSafe`
note: required by a bound in `ScopedClosure::<'static, T>::new`
   --> C:\Users\HeartofPhos\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\wasm-bindgen-0.2.114\src\closure.rs:244:33
    |
242 |     pub fn new<F>(t: F) -> Self
    |            --- required by a bound in this associated function
243 |     where
244 |         F: IntoWasmClosure<T> + MaybeUnwindSafe + 'static,
    |                                 ^^^^^^^^^^^^^^^ required by this bound in `ScopedClosure::<'static, T>::new`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `web-task` (lib) due to 1 previous error

updating Cargo.toml with wasm-bindgen = { version = "=0.2.108", default-features = false } successfully compiles

Ngôn ngữ chính
Rust
Star
11
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bevyengine/web-task

Tất cả issue của bevyengine/web-task

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.