Test wasm32-wasip1 in CI, not wasm32-unknown-unknown by alexcrichton · Pull Request #122036 · rust-lang/rust (original) (raw)
Ah ok I see, but at least in my experience you rarely want to just take &Path
when it's common to take string literals, which typically leads to something like path: impl AsRef<Path>
.
Either that or put another way the boilerplate of requiring Path::new("some literal")
probably won't necessarily make it too much harder to shoot yourself in the foot with paths (vs just passing "some literal"
).
From above, though, could you elaborate on:
because some tools/executables properly normalize/convert a Unix-y input path so they work on Windows properly, but other tools just give up
AFAIK native Windows APIs, which anything going through Rust uses (e.g. the run_make_support
crate), will never normalize anything. Instead Windows allows both /
and \
as path separators which is why c:\a/b\c
works. I believe that "verbatim paths" which IIRC are something like \\?\...
(or something like that sorry I forget the specifics) require that the path separator is \
, not /
, but AFAIK that's pretty rare.
That's all to say, while I know that mingw/cygwin/etc can cause confusion with paths I've rarely run into /
not working as a path separator except in the rare case of verbatim paths.