about summary refs log tree commit diff
path: root/library/std/src/sys/random/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-03 14:20:23 +0000
committerbors <bors@rust-lang.org>2025-09-03 14:20:23 +0000
commitfd75a9c32d643f39c8c61df770d2cff60b3fefd5 (patch)
treec37bb00bebb8e080cb67262f51620a3ee816220f /library/std/src/sys/random/mod.rs
parent51ff895062ba60a7cba53f57af928c3fb7b0f2f4 (diff)
parent263048d06327d104e4e49d1288bc392c96c494fe (diff)
downloadrust-fd75a9c32d643f39c8c61df770d2cff60b3fefd5.tar.gz
rust-fd75a9c32d643f39c8c61df770d2cff60b3fefd5.zip
Auto merge of #146160 - Zalathar:rollup-qxphx7g, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#145279 (Constify conversion traits (part 1))
 - rust-lang/rust#145414 (unicode-table-generator refactors)
 - rust-lang/rust#145823 (editorconfig: don't use nonexistent syntax)
 - rust-lang/rust#145944 (std: Start supporting WASIp2 natively )
 - rust-lang/rust#145961 (resolve: Avoid a regression from splitting prelude into two scopes)
 - rust-lang/rust#146032 (Explicity disable LSX feature for `loongarch64-unknown-none` target)
 - rust-lang/rust#146106 (fix(lexer): Only allow horizontal whitespace in frontmatter )
 - rust-lang/rust#146154 (CI: rfl: move job forward to Linux v6.17-rc3 plus 2 commits)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/random/mod.rs')
-rw-r--r--library/std/src/sys/random/mod.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/library/std/src/sys/random/mod.rs b/library/std/src/sys/random/mod.rs
index a7fbae86099..1e0eec07b50 100644
--- a/library/std/src/sys/random/mod.rs
+++ b/library/std/src/sys/random/mod.rs
@@ -86,9 +86,13 @@ cfg_select! {
         mod vxworks;
         pub use vxworks::fill_bytes;
     }
-    target_os = "wasi" => {
-        mod wasi;
-        pub use wasi::fill_bytes;
+    all(target_os = "wasi", target_env = "p1") => {
+        mod wasip1;
+        pub use wasip1::fill_bytes;
+    }
+    all(target_os = "wasi", target_env = "p2") => {
+        mod wasip2;
+        pub use wasip2::{fill_bytes, hashmap_random_keys};
     }
     target_os = "zkvm" => {
         mod zkvm;
@@ -110,6 +114,7 @@ cfg_select! {
     target_os = "linux",
     target_os = "android",
     all(target_family = "wasm", target_os = "unknown"),
+    all(target_os = "wasi", target_env = "p2"),
     target_os = "xous",
 )))]
 pub fn hashmap_random_keys() -> (u64, u64) {