From 494d6e514bb29341270720067d9842e8862704f8 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Wed, 30 Sep 2020 13:12:25 +0100 Subject: [PATCH] Fix is_absolute on WASI WASI does not match `cfg(unix)`, but its paths are Unix-like (`/some/path`) and don't have Windows-like prefixes. Without this change, `is_absolute` for paths like `/some/path` was returning `false`on a WASI target, which is obviously not true and undesirable. --- library/std/src/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index b83c1e9628d..6fa73042a30 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1838,7 +1838,7 @@ impl Path { // FIXME: Allow Redox prefixes self.has_root() || has_redox_scheme(self.as_u8_slice()) } else { - self.has_root() && (cfg!(unix) || self.prefix().is_some()) + self.has_root() && (cfg!(any(unix, target_os = "wasi")) || self.prefix().is_some()) } }