Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Host resources wit-bindgen code generation (bytecodealliance#6886)
* added trap to resource dtor * basic resources * fixed signature and trait bounds * fixed static function * fixed trait signature * basic resources * added result to resource drop * reverted formatting * added doc comment to resource `dtor` * fixed merge issue * fixed another merge issue * added resource import codegen test * Revert changes to `Cargo.lock` * Update `Cargo.lock` with the wit-bindgen update * Add `cargo vet` entries for new crates * Restore old-style of printing types in bindgen Avoid collecting resources-as-we-go in favor of doing that more declaratively elsewhere. Additionally handle imported-vs-exported resource via the order that interfaces are visited. * Update the shape of resource traits: * Use `&mut self` instead of `StoreContextMut` * Make resource traits as supertraits of the `Host` trait generated for each resource. * More uniformly handle types/returns with resource methods. * Fix derivations of `Clone` and `Copy` for where handles are contained. * Fix generation of handle typedefs * Support resources-in-worlds * Remove now-duplicate function This is now the same as the preexisting `generate_function_trait_sig` * Fix classifying handles as imported or exported This determination happens by looking up the origin definition of a resource, not the leaf possibly-aliased type. * Fix chains-of-use of resources Resources don't have their representation asserted since the bare type itself doesn't implement `ComponentType`, but otherwise generate type aliases the same way as other type aliases. * Revert `Cargo.lock` changes No need to update `wit-bindgen` to 0.10.0 just yet, that'll happen in a future update if necessary. * Add basic runtime tests for resources * fixed merge issue --------- Co-authored-by: Alex Crichton <alex@alexcrichton.com>
- Loading branch information