about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-16 14:58:14 +0000
committerbors <bors@rust-lang.org>2020-06-16 14:58:14 +0000
commita647c0cd68bdd0f15081019f0b21bc31ae23f072 (patch)
tree2e5ec96c4bbeedd4a6951c61505e2dd517037b21 /src/libstd
parent435f97cec1f0d7de95a0b80e95f295ab444b2fce (diff)
parentb4dd6a0dc43f85d9fcd9cfaf45a5c5d854ee13ae (diff)
downloadrust-a647c0cd68bdd0f15081019f0b21bc31ae23f072.tar.gz
rust-a647c0cd68bdd0f15081019f0b21bc31ae23f072.zip
Auto merge of #73402 - Dylan-DPC:rollup-8udzpfu, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #73237 (Check for overflow in DroplessArena and align returned memory)
 - #73339 (Don't run generator transform when there's a TyErr)
 - #73372 (Re-order correctly the sections in the sidebar)
 - #73373 (Use track caller for bug! macro)
 - #73380 (Add more info to `x.py build --help` on default value for `-j JOBS`.)
 - #73381 (Fix typo in docs of std::mem)
 - #73389 (Use `Ipv4Addr::from<[u8; 4]>` when possible)
 - #73400 (Fix forge-platform-support URL)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/panicking.rs13
-rw-r--r--src/libstd/sys/hermit/net.rs10
2 files changed, 5 insertions, 18 deletions
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs
index 6a120f930ab..d22ac1d5385 100644
--- a/src/libstd/panicking.rs
+++ b/src/libstd/panicking.rs
@@ -201,8 +201,7 @@ fn default_hook(info: &PanicInfo<'_>) {
                 if FIRST_PANIC.swap(false, Ordering::SeqCst) {
                     let _ = writeln!(
                         err,
-                        "note: run with `RUST_BACKTRACE=1` \
-                                           environment variable to display a backtrace"
+                        "note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace"
                     );
                 }
             }
@@ -454,10 +453,7 @@ fn rust_panic_with_hook(
     // process real quickly as we don't want to try calling it again as it'll
     // probably just panic again.
     if panics > 2 {
-        util::dumb_print(format_args!(
-            "thread panicked while processing \
-                                       panic. aborting.\n"
-        ));
+        util::dumb_print(format_args!("thread panicked while processing panic. aborting.\n"));
         intrinsics::abort()
     }
 
@@ -489,10 +485,7 @@ fn rust_panic_with_hook(
         // have limited options. Currently our preference is to
         // just abort. In the future we may consider resuming
         // unwinding or otherwise exiting the thread cleanly.
-        util::dumb_print(format_args!(
-            "thread panicked while panicking. \
-                                       aborting.\n"
-        ));
+        util::dumb_print(format_args!("thread panicked while panicking. aborting.\n"));
         intrinsics::abort()
     }
 
diff --git a/src/libstd/sys/hermit/net.rs b/src/libstd/sys/hermit/net.rs
index 9e588c4265a..8a788a9265f 100644
--- a/src/libstd/sys/hermit/net.rs
+++ b/src/libstd/sys/hermit/net.rs
@@ -147,10 +147,7 @@ impl TcpStream {
             .map_err(|_| io::Error::new(ErrorKind::Other, "peer_addr failed"))?;
 
         let saddr = match ipaddr {
-            Ipv4(ref addr) => SocketAddr::new(
-                IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])),
-                port,
-            ),
+            Ipv4(ref addr) => SocketAddr::new(IpAddr::V4(Ipv4Addr::from(addr.0)), port),
             Ipv6(ref addr) => SocketAddr::new(IpAddr::V6(Ipv6Addr::from(addr.0)), port),
             _ => {
                 return Err(io::Error::new(ErrorKind::Other, "peer_addr failed"));
@@ -227,10 +224,7 @@ impl TcpListener {
         let (handle, ipaddr, port) = abi::tcplistener::accept(self.0.port())
             .map_err(|_| io::Error::new(ErrorKind::Other, "accept failed"))?;
         let saddr = match ipaddr {
-            Ipv4(ref addr) => SocketAddr::new(
-                IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])),
-                port,
-            ),
+            Ipv4(ref addr) => SocketAddr::new(IpAddr::V4(Ipv4Addr::from(addr.0)), port),
             Ipv6(ref addr) => SocketAddr::new(IpAddr::V6(Ipv6Addr::from(addr.0)), port),
             _ => {
                 return Err(io::Error::new(ErrorKind::Other, "accept failed"));