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.
This commit is contained in:
parent
12f667fac3
commit
494d6e514b
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user