Skip to content

Commit d6f93fd

Browse files
committed
Auto merge of rust-lang#87808 - JohnTitor:rollup-qqp79xs, r=JohnTitor
Rollup of 9 pull requests Successful merges: - rust-lang#87561 (thread set_name haiku implementation.) - rust-lang#87715 (Add long error explanation for E0625) - rust-lang#87727 (explicit_generic_args_with_impl_trait: fix min expected number of generics) - rust-lang#87742 (Validate FFI-safety warnings on naked functions) - rust-lang#87756 (Add back -Zno-profiler-runtime) - rust-lang#87759 (Re-use std::sealed::Sealed in os/linux/process.) - rust-lang#87760 (Promote `aarch64-apple-ios-sim` to Tier 2) - rust-lang#87770 (permit drop impls with generic constants in where clauses) - rust-lang#87780 (alloc: Use intra doc links for the reserve function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 58edd24 + 19fe8ce commit d6f93fd

File tree

7 files changed

+31
-19
lines changed

7 files changed

+31
-19
lines changed

alloc/src/collections/vec_deque/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,9 @@ impl<T, A: Allocator> VecDeque<T, A> {
697697
///
698698
/// Note that the allocator may give the collection more space than it
699699
/// requests. Therefore, capacity can not be relied upon to be precisely
700-
/// minimal. Prefer `reserve` if future insertions are expected.
700+
/// minimal. Prefer [`reserve`] if future insertions are expected.
701+
///
702+
/// [`reserve`]: VecDeque::reserve
701703
///
702704
/// # Errors
703705
///

alloc/src/string.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,9 @@ impl String {
10351035
///
10361036
/// Note that the allocator may give the collection more space than it
10371037
/// requests. Therefore, capacity can not be relied upon to be precisely
1038-
/// minimal. Prefer `reserve` if future insertions are expected.
1038+
/// minimal. Prefer [`reserve`] if future insertions are expected.
1039+
///
1040+
/// [`reserve`]: String::reserve
10391041
///
10401042
/// # Errors
10411043
///

alloc/src/vec/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,9 @@ impl<T, A: Allocator> Vec<T, A> {
811811
///
812812
/// Note that the allocator may give the collection more space than it
813813
/// requests. Therefore, capacity can not be relied upon to be precisely
814-
/// minimal. Prefer `reserve` if future insertions are expected.
814+
/// minimal. Prefer [`reserve`] if future insertions are expected.
815+
///
816+
/// [`reserve`]: Vec::reserve
815817
///
816818
/// # Panics
817819
///
@@ -875,7 +877,9 @@ impl<T, A: Allocator> Vec<T, A> {
875877
///
876878
/// Note that the allocator may give the collection more space than it
877879
/// requests. Therefore, capacity can not be relied upon to be precisely
878-
/// minimal. Prefer `reserve` if future insertions are expected.
880+
/// minimal. Prefer [`reserve`] if future insertions are expected.
881+
///
882+
/// [`reserve`]: Vec::reserve
879883
///
880884
/// # Errors
881885
///

std/src/ffi/os_str.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ impl OsString {
271271
///
272272
/// Note that the allocator may give the collection more space than it
273273
/// requests. Therefore, capacity can not be relied upon to be precisely
274-
/// minimal. Prefer reserve if future insertions are expected.
274+
/// minimal. Prefer [`reserve`] if future insertions are expected.
275+
///
276+
/// [`reserve`]: OsString::reserve
275277
///
276278
/// # Examples
277279
///

std/src/os/linux/process.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use crate::io::Result;
66
use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
77
use crate::process;
8+
use crate::sealed::Sealed;
89
#[cfg(not(doc))]
910
use crate::sys::fd::FileDesc;
1011
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
@@ -84,15 +85,10 @@ impl IntoRawFd for PidFd {
8485
}
8586
}
8687

87-
mod private_child_ext {
88-
pub trait Sealed {}
89-
impl Sealed for crate::process::Child {}
90-
}
91-
9288
/// Os-specific extensions for [`Child`]
9389
///
9490
/// [`Child`]: process::Child
95-
pub trait ChildExt: private_child_ext::Sealed {
91+
pub trait ChildExt: Sealed {
9692
/// Obtains a reference to the [`PidFd`] created for this [`Child`], if available.
9793
///
9894
/// A pidfd will only be available if its creation was requested with
@@ -120,15 +116,10 @@ pub trait ChildExt: private_child_ext::Sealed {
120116
fn take_pidfd(&mut self) -> Result<PidFd>;
121117
}
122118

123-
mod private_command_ext {
124-
pub trait Sealed {}
125-
impl Sealed for crate::process::Command {}
126-
}
127-
128119
/// Os-specific extensions for [`Command`]
129120
///
130121
/// [`Command`]: process::Command
131-
pub trait CommandExt: private_command_ext::Sealed {
122+
pub trait CommandExt: Sealed {
132123
/// Sets whether a [`PidFd`](struct@PidFd) should be created for the [`Child`]
133124
/// spawned by this [`Command`].
134125
/// By default, no pidfd will be created.

std/src/process.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ pub struct Child {
205205
pub stderr: Option<ChildStderr>,
206206
}
207207

208+
/// Allows extension traits within `std`.
209+
#[unstable(feature = "sealed", issue = "none")]
210+
impl crate::sealed::Sealed for Child {}
211+
208212
impl AsInner<imp::Process> for Child {
209213
fn as_inner(&self) -> &imp::Process {
210214
&self.handle

std/src/sys/unix/thread.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,23 @@ impl Thread {
164164
}
165165
}
166166

167+
#[cfg(target_os = "haiku")]
168+
pub fn set_name(name: &CStr) {
169+
unsafe {
170+
let thread_self = libc::find_thread(ptr::null_mut());
171+
libc::rename_thread(thread_self, name.as_ptr());
172+
}
173+
}
174+
167175
#[cfg(any(
168176
target_env = "newlib",
169-
target_os = "haiku",
170177
target_os = "l4re",
171178
target_os = "emscripten",
172179
target_os = "redox",
173180
target_os = "vxworks"
174181
))]
175182
pub fn set_name(_name: &CStr) {
176-
// Newlib, Haiku, Emscripten, and VxWorks have no way to set a thread name.
183+
// Newlib, Emscripten, and VxWorks have no way to set a thread name.
177184
}
178185

179186
pub fn sleep(dur: Duration) {

0 commit comments

Comments
 (0)