Skip to content

Commit 81ec11f

Browse files
committed
Auto merge of #111710 - Dylan-DPC:rollup-eutrx54, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - #110884 (Support RISC-V unaligned-scalar-mem target feature) - #111160 (Update serde in workspace and non-synced dependencies) - #111168 (Specialize ToString implementation for fmt::Arguments) - #111527 (add examples of port 0 binding behavior) - #111561 (Include better context for "already exists" error in compiletest) - #111633 (Avoid `&format("...")` calls in error message code.) - #111679 (Remove libs message about ACPs from triagebot) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7d8b77f + 64d420a commit 81ec11f

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

alloc/src/string.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,6 +2623,15 @@ impl ToString for String {
26232623
}
26242624
}
26252625

2626+
#[cfg(not(no_global_oom_handling))]
2627+
#[stable(feature = "fmt_arguments_to_string_specialization", since = "CURRENT_RUSTC_VERSION")]
2628+
impl ToString for fmt::Arguments<'_> {
2629+
#[inline]
2630+
fn to_string(&self) -> String {
2631+
crate::fmt::format(*self)
2632+
}
2633+
}
2634+
26262635
#[stable(feature = "rust1", since = "1.0.0")]
26272636
impl AsRef<str> for String {
26282637
#[inline]

std/src/net/tcp.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,15 @@ impl TcpListener {
756756
/// ];
757757
/// let listener = TcpListener::bind(&addrs[..]).unwrap();
758758
/// ```
759+
///
760+
/// Creates a TCP listener bound to a port assigned by the operating system
761+
/// at `127.0.0.1`.
762+
///
763+
/// ```no_run
764+
/// use std::net::TcpListener;
765+
///
766+
/// let socket = TcpListener::bind("127.0.0.1:0").unwrap();
767+
/// ```
759768
#[stable(feature = "rust1", since = "1.0.0")]
760769
pub fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<TcpListener> {
761770
super::each_addr(addr, net_imp::TcpListener::bind).map(TcpListener)

std/src/net/udp.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ impl UdpSocket {
9090
/// ];
9191
/// let socket = UdpSocket::bind(&addrs[..]).expect("couldn't bind to address");
9292
/// ```
93+
///
94+
/// Creates a UDP socket bound to a port assigned by the operating system
95+
/// at `127.0.0.1`.
96+
///
97+
/// ```no_run
98+
/// use std::net::UdpSocket;
99+
///
100+
/// let socket = UdpSocket::bind("127.0.0.1:0").unwrap();
101+
/// ```
93102
#[stable(feature = "rust1", since = "1.0.0")]
94103
pub fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<UdpSocket> {
95104
super::each_addr(addr, net_imp::UdpSocket::bind).map(UdpSocket)

0 commit comments

Comments
 (0)