Commit 25f16f93 authored by Luke Sandberg's avatar Luke Sandberg

Fix compilation errors in wasmtime backend implementation

- Remove unused import (std::sync::Arc)
- Use raw pointer approach for Caller trait implementation to work
  around Rust lifetime constraints with wasmtime::Caller parameter
- Implement runtime::Caller trait methods using unsafe pointer access,
  which is safe because the pointer lifetime is controlled within
  the host function closure

The key challenge was that wasmtime's closure signature provides a
Caller parameter with a specific lifetime that doesn't satisfy the
trait object requirements for runtime::Caller. The solution uses
unsafe pointer casting with careful lifetime management to bridge
the gap between wasmtime's API and swc_plugin_runner's trait interface.
parent 1e7b3e3f
This diff is collapsed.
...@@ -317,7 +317,7 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" } ...@@ -317,7 +317,7 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" }
turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" } turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" }
# SWC crates # SWC crates
swc_core = { version = "57.0.0", features = [ swc_core = { version = "57.0.0", default-features = false, features = [
"ecma_loader_lru", "ecma_loader_lru",
"ecma_loader_parking_lot", "ecma_loader_parking_lot",
"parallel_rayon", "parallel_rayon",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment