You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#133339 - jieyouxu:rollup-gav0nvr, r=jieyouxu
Rollup of 8 pull requests
Successful merges:
- rust-lang#133238 (re-export `is_loongarch_feature_detected`)
- rust-lang#133288 (Support `each_ref` and `each_mut` in `[T; N]` in constant expressions.)
- rust-lang#133311 (Miri subtree update)
- rust-lang#133313 (Use arc4random of libc for RTEMS target)
- rust-lang#133319 (Simplify `fulfill_implication`)
- rust-lang#133323 (Bail in effects in old solver if self ty is ty var)
- rust-lang#133330 (library: update comment around close())
- rust-lang#133337 (Fix typo in `std::thread::Scope::spawn` documentation.)
r? `@ghost`
`@rustbot` modify labels: rollup
// FIXME(const-hack): We would like to simply use iterators for this (as in the original implementation), but this is not allowed in constant expressions.
616
+
letmut i = 0;
617
+
while i < N{
618
+
buf[i] = &rawconstself[i];
619
+
620
+
i += 1;
621
+
}
622
+
623
+
// SAFETY: `*const T` has the same layout as `&T`, and we've also initialised each pointer as a valid reference.
624
+
unsafe{transmute_unchecked(buf)}
611
625
}
612
626
613
627
/// Borrows each element mutably and returns an array of mutable references
// FIXME(const-hack): We would like to simply use iterators for this (as in the original implementation), but this is not allowed in constant expressions.
647
+
letmut i = 0;
648
+
while i < N{
649
+
buf[i] = &rawmutself[i];
650
+
651
+
i += 1;
652
+
}
653
+
654
+
// SAFETY: `*mut T` has the same layout as `&mut T`, and we've also initialised each pointer as a valid reference.
655
+
unsafe{transmute_unchecked(buf)}
630
656
}
631
657
632
658
/// Divides one array reference into two at an index.
Copy file name to clipboardexpand all lines: std/src/sys/random/arc4random.rs
-2
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,6 @@
12
12
#[cfg(not(any(
13
13
target_os = "haiku",
14
14
target_os = "illumos",
15
-
target_os = "rtems",
16
15
target_os = "solaris",
17
16
target_os = "vita",
18
17
)))]
@@ -22,7 +21,6 @@ use libc::arc4random_buf;
22
21
#[cfg(any(
23
22
target_os = "haiku",// See https://git.haiku-os.org/haiku/tree/headers/compatibility/bsd/stdlib.h
24
23
target_os = "illumos",// See https://www.illumos.org/man/3C/arc4random
25
-
target_os = "rtems",// See https://docs.rtems.org/branches/master/bsp-howto/getentropy.html
26
24
target_os = "solaris",// See https://docs.oracle.com/cd/E88353_01/html/E37843/arc4random-3c.html
27
25
target_os = "vita",// See https://github.com/vitasdk/newlib/blob/b89e5bc183b516945f9ee07eef483ecb916e45ff/newlib/libc/include/stdlib.h#L74
0 commit comments