about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-14 04:09:33 +0100
committerGitHub <noreply@github.com>2024-12-14 04:09:33 +0100
commitc58b8bc1bf29cff684e60fe6c8b95256e28ada11 (patch)
tree5d6840f234ad331634c5dfbffadc1b59a6466a7c
parent4a204bebdfd5cbc3e7edabf41cda3c3ff8b74917 (diff)
parent907846e01b759cda8da7f3ac369b657e29bdff54 (diff)
downloadrust-c58b8bc1bf29cff684e60fe6c8b95256e28ada11.tar.gz
rust-c58b8bc1bf29cff684e60fe6c8b95256e28ada11.zip
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.
-rw-r--r--library/std/src/path.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 5b277a982ee..35e920ab344 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -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())
         }
     }