about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-03-17 23:39:51 +0000
committerbors <bors@rust-lang.org>2021-03-17 23:39:51 +0000
commit146f5745606b48afca8e7d7702e363e88caa80e1 (patch)
tree28f5a4d7b7c985a5f6ec77b1d2ee24cf0a901f71 /library/std/src/sys/unix/stack_overflow.rs
parent36f1f04f18b89ba4a999bcfd6584663fd6fc1c5d (diff)
parent1839d1d57d5f4292eeadb419bc0c1e92fa9b478a (diff)
downloadrust-146f5745606b48afca8e7d7702e363e88caa80e1.tar.gz
rust-146f5745606b48afca8e7d7702e363e88caa80e1.zip
Auto merge of #83247 - Dylan-DPC:rollup-bdwmvjg, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #82191 (Vec::dedup_by optimization)
 - #82270 (Emit error when trying to use assembler syntax directives in `asm!`)
 - #82434 (Add more links between hash and btree collections)
 - #83080 (Make source-based code coverage compatible with MIR inlining)
 - #83168 (Extend `proc_macro_back_compat` lint to `procedural-masquerade`)
 - #83192 (ci/docker: Add SDK/NDK level 21 to android docker for 32bit platforms)
 - #83204 (Simplify C compilation for Fortanix-SGX target)
 - #83216 (Allow registering tool lints with `register_tool`)
 - #83223 (Display error details when a `mmap` call fails)
 - #83228 (Don't show HTML diff if tidy isn't installed for rustdoc tests)
 - #83231 (Switch riscvgc-unknown-none-elf use lp64d ABI)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
-rw-r--r--library/std/src/sys/unix/stack_overflow.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/stack_overflow.rs b/library/std/src/sys/unix/stack_overflow.rs
index d7bba50c76a..2a487fff54a 100644
--- a/library/std/src/sys/unix/stack_overflow.rs
+++ b/library/std/src/sys/unix/stack_overflow.rs
@@ -39,6 +39,7 @@ impl Drop for Handler {
 ))]
 mod imp {
     use super::Handler;
+    use crate::io;
     use crate::mem;
     use crate::ptr;
 
@@ -149,11 +150,11 @@ mod imp {
             0,
         );
         if stackp == MAP_FAILED {
-            panic!("failed to allocate an alternative stack");
+            panic!("failed to allocate an alternative stack: {}", io::Error::last_os_error());
         }
         let guard_result = libc::mprotect(stackp, page_size(), PROT_NONE);
         if guard_result != 0 {
-            panic!("failed to set up alternative stack guard page");
+            panic!("failed to set up alternative stack guard page: {}", io::Error::last_os_error());
         }
         stackp.add(page_size())
     }