Skip to content

Commit 55d0959

Browse files
authored
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.
2 parents bf15fcd + 494d6e5 commit 55d0959

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ impl Path {
18381838
// FIXME: Allow Redox prefixes
18391839
self.has_root() || has_redox_scheme(self.as_u8_slice())
18401840
} else {
1841-
self.has_root() && (cfg!(unix) || self.prefix().is_some())
1841+
self.has_root() && (cfg!(any(unix, target_os = "wasi")) || self.prefix().is_some())
18421842
}
18431843
}
18441844

0 commit comments

Comments
 (0)