Change WASI trait impls back to being blanket impls #8766
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit is a partial revert of #8609 to return
wasmtime-wasi
andwasmtime-wasi-http
back to using blanket impls. The main change from before is to change the blanket impls to be in terms of a local newtype wrapper to avoid trait coherence issues. This is done because otherwise using the traits before required&mut dyn WasiView
to exist but sometimes only aFoo<'a>
is held which is not easy to get a&mut dyn ...
view of. By changing to a blanket impl in terms of a newtype wrapper,WasiImpl
, it's possible to callbindgen!
-generatedadd_to_linker_get_host
functions with a return value ofWasiImpl<Foo<'a>>
which enables hooking into all the generated bindings.