Auto merge of #136087 - jhpratt:rollup-tam1mzn, r=jhpratt
Rollup of 7 pull requests Successful merges: - #133631 (Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only)) - #134358 (compiler: Set `target_abi = "ilp32e"` on all riscv32e targets) - #135812 (Fix GDB `OsString` provider on Windows ) - #135842 (TRPL: more backward-compatible Edition changes) - #135946 (Remove extra whitespace from rustdoc breadcrumbs for copypasting) - #135953 (ci.py: check the return code in `run-local`) - #136019 (Add an `unchecked_div` alias to the `Div<NonZero<_>>` impls) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
15c6f7e1a3
26 changed files with 310 additions and 156 deletions
|
@ -1185,8 +1185,12 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
|
|||
impl Div<NonZero<$Int>> for $Int {
|
||||
type Output = $Int;
|
||||
|
||||
/// Same as `self / other.get()`, but because `other` is a `NonZero<_>`,
|
||||
/// there's never a runtime check for division-by-zero.
|
||||
///
|
||||
/// This operation rounds towards zero, truncating any fractional
|
||||
/// part of the exact result, and cannot panic.
|
||||
#[doc(alias = "unchecked_div")]
|
||||
#[inline]
|
||||
fn div(self, other: NonZero<$Int>) -> $Int {
|
||||
// SAFETY: Division by zero is checked because `other` is non-zero,
|
||||
|
@ -1197,6 +1201,9 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
|
|||
|
||||
#[stable(feature = "nonzero_div_assign", since = "1.79.0")]
|
||||
impl DivAssign<NonZero<$Int>> for $Int {
|
||||
/// Same as `self /= other.get()`, but because `other` is a `NonZero<_>`,
|
||||
/// there's never a runtime check for division-by-zero.
|
||||
///
|
||||
/// This operation rounds towards zero, truncating any fractional
|
||||
/// part of the exact result, and cannot panic.
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue