Skip to content

Commit b8b3b41

Browse files
committed
Auto merge of rust-lang#138956 - jhpratt:rollup-6g7ppwd, r=jhpratt
Rollup of 11 pull requests Successful merges: - rust-lang#138128 (Stabilize `#![feature(precise_capturing_in_traits)]`) - rust-lang#138834 (Group test diffs by stage in post-merge analysis) - rust-lang#138867 (linker: Fix staticlib naming for UEFI) - rust-lang#138874 (Batch mark waiters as unblocked when resuming in the deadlock handler) - rust-lang#138875 (Trusty: Fix build for anonymous pipes and std::sys::process) - rust-lang#138877 (Ignore doctests only in specified targets) - rust-lang#138885 (Fix ui pattern_types test for big-endian platforms) - rust-lang#138905 (Add target maintainer information for powerpc64-unknown-linux-musl) - rust-lang#138911 (Allow defining opaques in statics and consts) - rust-lang#138917 (rustdoc: remove useless `Symbol::is_empty` checks.) - rust-lang#138945 (Override PartialOrd methods for bool) r? `@ghost` `@rustbot` modify labels: rollup
2 parents fd85da0 + 51a22a0 commit b8b3b41

File tree

4 files changed

+37
-33
lines changed

4 files changed

+37
-33
lines changed

Diff for: core/src/cmp.rs

+23-27
Original file line numberDiff line numberDiff line change
@@ -1810,9 +1810,9 @@ mod impls {
18101810
#[stable(feature = "rust1", since = "1.0.0")]
18111811
impl PartialEq for $t {
18121812
#[inline]
1813-
fn eq(&self, other: &$t) -> bool { (*self) == (*other) }
1813+
fn eq(&self, other: &Self) -> bool { *self == *other }
18141814
#[inline]
1815-
fn ne(&self, other: &$t) -> bool { (*self) != (*other) }
1815+
fn ne(&self, other: &Self) -> bool { *self != *other }
18161816
}
18171817
)*)
18181818
}
@@ -1842,8 +1842,18 @@ mod impls {
18421842

18431843
eq_impl! { () bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
18441844

1845-
macro_rules! chaining_methods_impl {
1846-
($t:ty) => {
1845+
#[rustfmt::skip]
1846+
macro_rules! partial_ord_methods_primitive_impl {
1847+
() => {
1848+
#[inline(always)]
1849+
fn lt(&self, other: &Self) -> bool { *self < *other }
1850+
#[inline(always)]
1851+
fn le(&self, other: &Self) -> bool { *self <= *other }
1852+
#[inline(always)]
1853+
fn gt(&self, other: &Self) -> bool { *self > *other }
1854+
#[inline(always)]
1855+
fn ge(&self, other: &Self) -> bool { *self >= *other }
1856+
18471857
// These implementations are the same for `Ord` or `PartialOrd` types
18481858
// because if either is NAN the `==` test will fail so we end up in
18491859
// the `Break` case and the comparison will correctly return `false`.
@@ -1876,24 +1886,16 @@ mod impls {
18761886
#[stable(feature = "rust1", since = "1.0.0")]
18771887
impl PartialOrd for $t {
18781888
#[inline]
1879-
fn partial_cmp(&self, other: &$t) -> Option<Ordering> {
1889+
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
18801890
match (*self <= *other, *self >= *other) {
18811891
(false, false) => None,
18821892
(false, true) => Some(Greater),
18831893
(true, false) => Some(Less),
18841894
(true, true) => Some(Equal),
18851895
}
18861896
}
1887-
#[inline(always)]
1888-
fn lt(&self, other: &$t) -> bool { (*self) < (*other) }
1889-
#[inline(always)]
1890-
fn le(&self, other: &$t) -> bool { (*self) <= (*other) }
1891-
#[inline(always)]
1892-
fn ge(&self, other: &$t) -> bool { (*self) >= (*other) }
1893-
#[inline(always)]
1894-
fn gt(&self, other: &$t) -> bool { (*self) > (*other) }
1895-
1896-
chaining_methods_impl!($t);
1897+
1898+
partial_ord_methods_primitive_impl!();
18971899
}
18981900
)*)
18991901
}
@@ -1912,6 +1914,8 @@ mod impls {
19121914
fn partial_cmp(&self, other: &bool) -> Option<Ordering> {
19131915
Some(self.cmp(other))
19141916
}
1917+
1918+
partial_ord_methods_primitive_impl!();
19151919
}
19161920

19171921
partial_ord_impl! { f16 f32 f64 f128 }
@@ -1921,25 +1925,17 @@ mod impls {
19211925
#[stable(feature = "rust1", since = "1.0.0")]
19221926
impl PartialOrd for $t {
19231927
#[inline]
1924-
fn partial_cmp(&self, other: &$t) -> Option<Ordering> {
1928+
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
19251929
Some(crate::intrinsics::three_way_compare(*self, *other))
19261930
}
1927-
#[inline(always)]
1928-
fn lt(&self, other: &$t) -> bool { (*self) < (*other) }
1929-
#[inline(always)]
1930-
fn le(&self, other: &$t) -> bool { (*self) <= (*other) }
1931-
#[inline(always)]
1932-
fn ge(&self, other: &$t) -> bool { (*self) >= (*other) }
1933-
#[inline(always)]
1934-
fn gt(&self, other: &$t) -> bool { (*self) > (*other) }
1935-
1936-
chaining_methods_impl!($t);
1931+
1932+
partial_ord_methods_primitive_impl!();
19371933
}
19381934

19391935
#[stable(feature = "rust1", since = "1.0.0")]
19401936
impl Ord for $t {
19411937
#[inline]
1942-
fn cmp(&self, other: &$t) -> Ordering {
1938+
fn cmp(&self, other: &Self) -> Ordering {
19431939
crate::intrinsics::three_way_compare(*self, *other)
19441940
}
19451941
}

Diff for: std/src/os/fd/owned.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ use crate::mem::ManuallyDrop;
1515
target_os = "trusty"
1616
)))]
1717
use crate::sys::cvt;
18-
use crate::sys_common::FromInner;
1918
#[cfg(not(target_os = "trusty"))]
20-
use crate::sys_common::{AsInner, IntoInner};
19+
use crate::sys_common::{AsInner, FromInner, IntoInner};
2120
use crate::{fmt, io};
2221

2322
type ValidRawFd = core::num::niche_types::NotAllOnes<RawFd>;
@@ -507,41 +506,47 @@ impl<'a> AsFd for io::StderrLock<'a> {
507506
}
508507

509508
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
509+
#[cfg(not(target_os = "trusty"))]
510510
impl AsFd for io::PipeReader {
511511
fn as_fd(&self) -> BorrowedFd<'_> {
512512
self.0.as_fd()
513513
}
514514
}
515515

516516
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
517+
#[cfg(not(target_os = "trusty"))]
517518
impl From<io::PipeReader> for OwnedFd {
518519
fn from(pipe: io::PipeReader) -> Self {
519520
pipe.0.into_inner()
520521
}
521522
}
522523

523524
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
525+
#[cfg(not(target_os = "trusty"))]
524526
impl AsFd for io::PipeWriter {
525527
fn as_fd(&self) -> BorrowedFd<'_> {
526528
self.0.as_fd()
527529
}
528530
}
529531

530532
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
533+
#[cfg(not(target_os = "trusty"))]
531534
impl From<io::PipeWriter> for OwnedFd {
532535
fn from(pipe: io::PipeWriter) -> Self {
533536
pipe.0.into_inner()
534537
}
535538
}
536539

537540
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
541+
#[cfg(not(target_os = "trusty"))]
538542
impl From<OwnedFd> for io::PipeReader {
539543
fn from(owned_fd: OwnedFd) -> Self {
540544
Self(FromInner::from_inner(owned_fd))
541545
}
542546
}
543547

544548
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
549+
#[cfg(not(target_os = "trusty"))]
545550
impl From<OwnedFd> for io::PipeWriter {
546551
fn from(owned_fd: OwnedFd) -> Self {
547552
Self(FromInner::from_inner(owned_fd))

Diff for: std/src/os/fd/raw.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ use crate::os::unix::io::AsFd;
1818
use crate::os::unix::io::OwnedFd;
1919
#[cfg(target_os = "wasi")]
2020
use crate::os::wasi::io::OwnedFd;
21-
use crate::sys_common::FromInner;
2221
#[cfg(not(target_os = "trusty"))]
23-
use crate::sys_common::{AsInner, IntoInner};
22+
use crate::sys_common::{AsInner, FromInner, IntoInner};
2423

2524
/// Raw file descriptors.
2625
#[stable(feature = "rust1", since = "1.0.0")]
@@ -287,41 +286,47 @@ impl<T: AsRawFd> AsRawFd for Box<T> {
287286
}
288287

289288
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
289+
#[cfg(not(target_os = "trusty"))]
290290
impl AsRawFd for io::PipeReader {
291291
fn as_raw_fd(&self) -> RawFd {
292292
self.0.as_raw_fd()
293293
}
294294
}
295295

296296
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
297+
#[cfg(not(target_os = "trusty"))]
297298
impl FromRawFd for io::PipeReader {
298299
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
299300
Self::from_inner(unsafe { FromRawFd::from_raw_fd(raw_fd) })
300301
}
301302
}
302303

303304
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
305+
#[cfg(not(target_os = "trusty"))]
304306
impl IntoRawFd for io::PipeReader {
305307
fn into_raw_fd(self) -> RawFd {
306308
self.0.into_raw_fd()
307309
}
308310
}
309311

310312
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
313+
#[cfg(not(target_os = "trusty"))]
311314
impl AsRawFd for io::PipeWriter {
312315
fn as_raw_fd(&self) -> RawFd {
313316
self.0.as_raw_fd()
314317
}
315318
}
316319

317320
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
321+
#[cfg(not(target_os = "trusty"))]
318322
impl FromRawFd for io::PipeWriter {
319323
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
320324
Self::from_inner(unsafe { FromRawFd::from_raw_fd(raw_fd) })
321325
}
322326
}
323327

324328
#[stable(feature = "anonymous_pipe", since = "CURRENT_RUSTC_VERSION")]
329+
#[cfg(not(target_os = "trusty"))]
325330
impl IntoRawFd for io::PipeWriter {
326331
fn into_raw_fd(self) -> RawFd {
327332
self.0.into_raw_fd()

Diff for: std/src/sys/pal/trusty/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ pub mod env;
1111
pub mod os;
1212
#[path = "../unsupported/pipe.rs"]
1313
pub mod pipe;
14-
#[path = "../unsupported/process.rs"]
15-
pub mod process;
1614
#[path = "../unsupported/thread.rs"]
1715
pub mod thread;
1816
#[path = "../unsupported/time.rs"]

0 commit comments

Comments
 (0)