-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource::new_borrow()
resource -> ResourceAny
conversion panics
#7793
Comments
Ah yes I see where this is coming from and it's a bit unfortunate. Borrows have metadata tracking them to ensure that they're all dropped by the time a function call exits. For example if 4 borrows are given to an exported function then all borrows must be dropped by the exported function before the function returns, otherwise the component model requires a trap. I think that the implementation here is going to have to be a bit more "clever" like the bits in |
Test Case
Steps to Reproduce
(see test case)
Expected Results
Success, just like with lowering of
Resource
directlyActual Results
Panic in
wasmtime/crates/runtime/src/component/resources.rs
Line 241 in f3b5478
Versions and Environment
Wasmtime version or commit: f3b5478
Extra Info
The panic makes sense, since there is no "owned" version of this resource in any table, only a "synthetic" borrow.
I believe the panic is caused by
wasmtime/crates/wasmtime/src/component/resources.rs
Line 568 in f3b5478
Resource
, the analogous operation simply returns therep
wasmtime/crates/wasmtime/src/component/resources.rs
Line 334 in f3b5478
Refs #7688 #7783
The text was updated successfully, but these errors were encountered: