Lann

Results 146 comments of Lann

> @alexcrichton: > I can definitely say that the `&mut T -> &mut U` closures I've never felt great about. I've always preferred to do `&mut T -> U` with...

It turns out the closure lifetime problems were due to a type inference limitation: https://github.com/rust-lang/rust/issues/58052 This seems to work as a rough approach to improve on: ```rust use std::borrow::BorrowMut; trait...

After some more iteration here I've come up with something that solves my problems. I'm not really _happy_ with it but its the best compromise I've been able to make...

> Testing locally I think you can drop the `HostBorrowFn` struct entirely in favor of `impl GetHost for F` directly. I added `HostBorrowFn` to work around some coherence issue but...

I'll start on the PR. I also updated the gist with your suggestions in case someone is looking here before the PR is ready.

> One other minor possibility might be to have: (GAT stuff) I tried many variations with GATs but ended up playing whack-a-mole with various lifetime constraints. It may be possible...

This is what I was (vaguely) worried about: https://github.com/bytecodealliance/wasmtime/actions/runs/8805989303/job/24169783936?pr=8448#step:17:392 e.g. ``` error[E0119]: conflicting implementations of trait `async_io::wasi::sockets::ip_name_lookup::Host` for type `&mut _` --> crates/wasi/src/ip_name_lookup.rs:23:1 | 23 | impl Host for T...

From an out-of-band discussion, we're going to try: - Adding a `add_to_linker_with_closure: false` that allows opting-out of the generated `add_to_linker`, `impl Host for &mut Host`, and `impl GetHost for Fn(&mut...

Related discussion on Discord: https://discord.com/channels/926888690310053918/1081227946976616528/1081234846430535721 > I have several components + a "common/utils" crate where I have some functions used in my different components. When there is a failure in...

I wonder if the test definition manifest could be optional if a directory contains both a `spin.toml` and a e.g. `test.wasm`.