Rollup merge of #134252 - hermit-os:hermit-is_absolute, r=tgross35

Fix `Path::is_absolute` on Hermit

Paths on Hermit work like paths on Unix.

Closes https://github.com/rust-lang/rust/issues/132141.
This commit is contained in:
Matthias Krüger 2024-12-14 04:09:33 +01:00 committed by GitHub
commit c58b8bc1bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2327,7 +2327,9 @@ impl Path {
// FIXME: Allow Redox prefixes
self.has_root() || has_redox_scheme(self.as_u8_slice())
} else {
self.has_root() && (cfg!(any(unix, target_os = "wasi")) || self.prefix().is_some())
self.has_root()
&& (cfg!(any(unix, target_os = "hermit", target_os = "wasi"))
|| self.prefix().is_some())
}
}