Skip to content

Commit 68f6b01

Browse files
committed
Auto merge of rust-lang#136087 - jhpratt:rollup-tam1mzn, r=jhpratt
Rollup of 7 pull requests Successful merges: - rust-lang#133631 (Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only)) - rust-lang#134358 (compiler: Set `target_abi = "ilp32e"` on all riscv32e targets) - rust-lang#135812 (Fix GDB `OsString` provider on Windows ) - rust-lang#135842 (TRPL: more backward-compatible Edition changes) - rust-lang#135946 (Remove extra whitespace from rustdoc breadcrumbs for copypasting) - rust-lang#135953 (ci.py: check the return code in `run-local`) - rust-lang#136019 (Add an `unchecked_div` alias to the `Div<NonZero<_>>` impls) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c0037d7 + 7aec69a commit 68f6b01

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

core/src/num/nonzero.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1185,8 +1185,12 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
11851185
impl Div<NonZero<$Int>> for $Int {
11861186
type Output = $Int;
11871187

1188+
/// Same as `self / other.get()`, but because `other` is a `NonZero<_>`,
1189+
/// there's never a runtime check for division-by-zero.
1190+
///
11881191
/// This operation rounds towards zero, truncating any fractional
11891192
/// part of the exact result, and cannot panic.
1193+
#[doc(alias = "unchecked_div")]
11901194
#[inline]
11911195
fn div(self, other: NonZero<$Int>) -> $Int {
11921196
// SAFETY: Division by zero is checked because `other` is non-zero,
@@ -1197,6 +1201,9 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
11971201

11981202
#[stable(feature = "nonzero_div_assign", since = "1.79.0")]
11991203
impl DivAssign<NonZero<$Int>> for $Int {
1204+
/// Same as `self /= other.get()`, but because `other` is a `NonZero<_>`,
1205+
/// there's never a runtime check for division-by-zero.
1206+
///
12001207
/// This operation rounds towards zero, truncating any fractional
12011208
/// part of the exact result, and cannot panic.
12021209
#[inline]

std/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ test = true
139139
level = "warn"
140140
check-cfg = [
141141
'cfg(bootstrap)',
142-
'cfg(target_arch, values("xtensa"))',
142+
'cfg(target_arch, values("xtensa", "aarch64-unknown-nto-qnx710_iosock", "x86_64-pc-nto-qnx710_iosock", "x86_64-pc-nto-qnx800","aarch64-unknown-nto-qnx800"))',
143+
'cfg(target_env, values("nto71_iosock", "nto80"))',
143144
# std use #[path] imports to portable-simd `std_float` crate
144145
# and to the `backtrace` crate which messes-up with Cargo list
145146
# of declared features, we therefor expect any feature cfg

std/src/sys/pal/unix/process/process_unix.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ use crate::sys::process::process_common::*;
1919
use crate::{fmt, mem, sys};
2020

2121
cfg_if::cfg_if! {
22-
// This workaround is only needed for QNX 7.0 and 7.1. The bug should have been fixed in 8.0
23-
if #[cfg(any(target_env = "nto70", target_env = "nto71"))] {
22+
if #[cfg(target_os = "nto")] {
2423
use crate::thread;
2524
use libc::{c_char, posix_spawn_file_actions_t, posix_spawnattr_t};
2625
use crate::time::Duration;
@@ -187,12 +186,7 @@ impl Command {
187186

188187
// Attempts to fork the process. If successful, returns Ok((0, -1))
189188
// in the child, and Ok((child_pid, -1)) in the parent.
190-
#[cfg(not(any(
191-
target_os = "watchos",
192-
target_os = "tvos",
193-
target_env = "nto70",
194-
target_env = "nto71"
195-
)))]
189+
#[cfg(not(any(target_os = "watchos", target_os = "tvos", target_os = "nto")))]
196190
unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
197191
cvt(libc::fork())
198192
}
@@ -201,8 +195,7 @@ impl Command {
201195
// or closed a file descriptor while the fork() was occurring".
202196
// Documentation says "... or try calling fork() again". This is what we do here.
203197
// See also https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/f/fork.html
204-
// This workaround is only needed for QNX 7.0 and 7.1. The bug should have been fixed in 8.0
205-
#[cfg(any(target_env = "nto70", target_env = "nto71"))]
198+
#[cfg(target_os = "nto")]
206199
unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
207200
use crate::sys::os::errno;
208201

0 commit comments

Comments
 (0)