ci: test wasi on rust stable
It appears that we still need the wasip2 feature for:
https://github.com/bytecodealliance/rustix/blob/5245b8160d53a04c37164779cfb11d35e18f55b3/src/path/arg.rs#L350-L388
Otherwise, we can't use rustix's rename with a Path.
I think we can just use https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.as_encoded_bytes on wasip2, but I'm going to see if I can get upstream rustix to do it.
I realize Path -> str -> Path is not exactly safe but a temporary workaround for wasip2 could be just:
let old_path_str = old_path.to_str().ok_or(io::Error::new(
io::ErrorKind::InvalidInput,
"path not utf-8",
))?;
let new_path_str = new_path.to_str().ok_or(io::Error::new(
io::ErrorKind::InvalidInput,
"path not utf-8",
))?;
then just pass the Strings instead:
rename(old_path_str, new_path_str)?;
let _ = unlink(old_path_str);
Yep! But the fix has already been merged upstream so I'd rather wait for a release. I'll open an issue there.