Rollup merge of #77362 - RReverser:patch-1, r=dtolnay

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 any paths, including `/some/path`, was returning `false`on a WASI target, which is obviously not true and undesirable.
This commit is contained in:
Yuki Okushi 2020-10-02 08:25:19 +09:00 committed by GitHub
commit 55d0959328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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())
}
}