Auto merge of #138956 - jhpratt:rollup-6g7ppwd, r=jhpratt

Rollup of 11 pull requests

Successful merges:

 - #138128 (Stabilize `#![feature(precise_capturing_in_traits)]`)
 - #138834 (Group test diffs by stage in post-merge analysis)
 - #138867 (linker: Fix staticlib naming for UEFI)
 - #138874 (Batch mark waiters as unblocked when resuming in the deadlock handler)
 - #138875 (Trusty: Fix build for anonymous pipes and std::sys::process)
 - #138877 (Ignore doctests only in specified targets)
 - #138885 (Fix ui pattern_types test for big-endian platforms)
 - #138905 (Add target maintainer information for powerpc64-unknown-linux-musl)
 - #138911 (Allow defining opaques in statics and consts)
 - #138917 (rustdoc: remove useless `Symbol::is_empty` checks.)
 - #138945 (Override PartialOrd methods for bool)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-03-26 03:21:26 +00:00
commit 6e8abb5ec6
66 changed files with 629 additions and 410 deletions

View file

@ -1810,9 +1810,9 @@ mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
impl PartialEq for $t {
#[inline]
fn eq(&self, other: &$t) -> bool { (*self) == (*other) }
fn eq(&self, other: &Self) -> bool { *self == *other }
#[inline]
fn ne(&self, other: &$t) -> bool { (*self) != (*other) }
fn ne(&self, other: &Self) -> bool { *self != *other }
}
)*)
}
@ -1842,8 +1842,18 @@ mod impls {
eq_impl! { () bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
macro_rules! chaining_methods_impl {
($t:ty) => {
#[rustfmt::skip]
macro_rules! partial_ord_methods_primitive_impl {
() => {
#[inline(always)]
fn lt(&self, other: &Self) -> bool { *self < *other }
#[inline(always)]
fn le(&self, other: &Self) -> bool { *self <= *other }
#[inline(always)]
fn gt(&self, other: &Self) -> bool { *self > *other }
#[inline(always)]
fn ge(&self, other: &Self) -> bool { *self >= *other }
// These implementations are the same for `Ord` or `PartialOrd` types
// because if either is NAN the `==` test will fail so we end up in
// the `Break` case and the comparison will correctly return `false`.
@ -1876,7 +1886,7 @@ mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
impl PartialOrd for $t {
#[inline]
fn partial_cmp(&self, other: &$t) -> Option<Ordering> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
match (*self <= *other, *self >= *other) {
(false, false) => None,
(false, true) => Some(Greater),
@ -1884,16 +1894,8 @@ mod impls {
(true, true) => Some(Equal),
}
}
#[inline(always)]
fn lt(&self, other: &$t) -> bool { (*self) < (*other) }
#[inline(always)]
fn le(&self, other: &$t) -> bool { (*self) <= (*other) }
#[inline(always)]
fn ge(&self, other: &$t) -> bool { (*self) >= (*other) }
#[inline(always)]
fn gt(&self, other: &$t) -> bool { (*self) > (*other) }
chaining_methods_impl!($t);
partial_ord_methods_primitive_impl!();
}
)*)
}
@ -1912,6 +1914,8 @@ mod impls {
fn partial_cmp(&self, other: &bool) -> Option<Ordering> {
Some(self.cmp(other))
}
partial_ord_methods_primitive_impl!();
}
partial_ord_impl! { f16 f32 f64 f128 }
@ -1921,25 +1925,17 @@ mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
impl PartialOrd for $t {
#[inline]
fn partial_cmp(&self, other: &$t) -> Option<Ordering> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(crate::intrinsics::three_way_compare(*self, *other))
}
#[inline(always)]
fn lt(&self, other: &$t) -> bool { (*self) < (*other) }
#[inline(always)]
fn le(&self, other: &$t) -> bool { (*self) <= (*other) }
#[inline(always)]
fn ge(&self, other: &$t) -> bool { (*self) >= (*other) }
#[inline(always)]
fn gt(&self, other: &$t) -> bool { (*self) > (*other) }
chaining_methods_impl!($t);
partial_ord_methods_primitive_impl!();
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Ord for $t {
#[inline]
fn cmp(&self, other: &$t) -> Ordering {
fn cmp(&self, other: &Self) -> Ordering {
crate::intrinsics::three_way_compare(*self, *other)
}
}

View file

@ -15,9 +15,8 @@ use crate::mem::ManuallyDrop;
target_os = "trusty"
)))]
use crate::sys::cvt;
use crate::sys_common::FromInner;
#[cfg(not(target_os = "trusty"))]
use crate::sys_common::{AsInner, IntoInner};
use crate::sys_common::{AsInner, FromInner, IntoInner};
use crate::{fmt, io};
type ValidRawFd = core::num::niche_types::NotAllOnes<RawFd>;
@ -507,6 +506,7 @@ impl<'a> AsFd for io::StderrLock<'a> {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl AsFd for io::PipeReader {
fn as_fd(&self) -> BorrowedFd<'_> {
self.0.as_fd()
@ -514,6 +514,7 @@ impl AsFd for io::PipeReader {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl From<io::PipeReader> for OwnedFd {
fn from(pipe: io::PipeReader) -> Self {
pipe.0.into_inner()
@ -521,6 +522,7 @@ impl From<io::PipeReader> for OwnedFd {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl AsFd for io::PipeWriter {
fn as_fd(&self) -> BorrowedFd<'_> {
self.0.as_fd()
@ -528,6 +530,7 @@ impl AsFd for io::PipeWriter {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl From<io::PipeWriter> for OwnedFd {
fn from(pipe: io::PipeWriter) -> Self {
pipe.0.into_inner()
@ -535,6 +538,7 @@ impl From<io::PipeWriter> for OwnedFd {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl From<OwnedFd> for io::PipeReader {
fn from(owned_fd: OwnedFd) -> Self {
Self(FromInner::from_inner(owned_fd))
@ -542,6 +546,7 @@ impl From<OwnedFd> for io::PipeReader {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl From<OwnedFd> for io::PipeWriter {
fn from(owned_fd: OwnedFd) -> Self {
Self(FromInner::from_inner(owned_fd))

View file

@ -18,9 +18,8 @@ use crate::os::unix::io::AsFd;
use crate::os::unix::io::OwnedFd;
#[cfg(target_os = "wasi")]
use crate::os::wasi::io::OwnedFd;
use crate::sys_common::FromInner;
#[cfg(not(target_os = "trusty"))]
use crate::sys_common::{AsInner, IntoInner};
use crate::sys_common::{AsInner, FromInner, IntoInner};
/// Raw file descriptors.
#[stable(feature = "rust1", since = "1.0.0")]
@ -287,6 +286,7 @@ impl<T: AsRawFd> AsRawFd for Box<T> {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl AsRawFd for io::PipeReader {
fn as_raw_fd(&self) -> RawFd {
self.0.as_raw_fd()
@ -294,6 +294,7 @@ impl AsRawFd for io::PipeReader {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl FromRawFd for io::PipeReader {
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
Self::from_inner(unsafe { FromRawFd::from_raw_fd(raw_fd) })
@ -301,6 +302,7 @@ impl FromRawFd for io::PipeReader {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl IntoRawFd for io::PipeReader {
fn into_raw_fd(self) -> RawFd {
self.0.into_raw_fd()
@ -308,6 +310,7 @@ impl IntoRawFd for io::PipeReader {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl AsRawFd for io::PipeWriter {
fn as_raw_fd(&self) -> RawFd {
self.0.as_raw_fd()
@ -315,6 +318,7 @@ impl AsRawFd for io::PipeWriter {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl FromRawFd for io::PipeWriter {
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
Self::from_inner(unsafe { FromRawFd::from_raw_fd(raw_fd) })
@ -322,6 +326,7 @@ impl FromRawFd for io::PipeWriter {
}
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
#[cfg(not(target_os = "trusty"))]
impl IntoRawFd for io::PipeWriter {
fn into_raw_fd(self) -> RawFd {
self.0.into_raw_fd()

View file

@ -11,8 +11,6 @@ pub mod env;
pub mod os;
#[path = "../unsupported/pipe.rs"]
pub mod pipe;
#[path = "../unsupported/process.rs"]
pub mod process;
#[path = "../unsupported/thread.rs"]
pub mod thread;
#[path = "../unsupported/time.rs"]