Skip to content

Commit f6b7afe

Browse files
committed
Use std::process::abort()
1 parent 146000b commit f6b7afe

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

rayon-core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ categories = ["concurrency"]
1616
# Some dependencies may not be their latest version, in order to support older rustc.
1717
[dependencies]
1818
num_cpus = "1.2"
19-
libc = "0.2.16"
2019
lazy_static = "1"
2120
crossbeam-deque = "0.6.3"
2221
crossbeam-queue = "0.1.2"

rayon-core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ extern crate crossbeam_deque;
3535
extern crate crossbeam_queue;
3636
#[macro_use]
3737
extern crate lazy_static;
38-
extern crate libc;
3938
extern crate num_cpus;
4039

4140
#[cfg(test)]

rayon-core/src/unwind.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! accidental panics in the rayon code itself.
44
55
use std::any::Any;
6-
use std::io::prelude::*;
7-
use std::io::stderr;
86
use std::panic::{self, AssertUnwindSafe};
97
use std::thread;
108

@@ -25,22 +23,9 @@ pub fn resume_unwinding(payload: Box<Any + Send>) -> ! {
2523

2624
pub struct AbortIfPanic;
2725

28-
fn aborting() {
29-
let _ = writeln!(&mut stderr(), "Rayon: detected unexpected panic; aborting");
30-
}
31-
3226
impl Drop for AbortIfPanic {
33-
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
34-
fn drop(&mut self) {
35-
aborting();
36-
::std::process::abort(); // stable in rust 1.17
37-
}
38-
39-
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
4027
fn drop(&mut self) {
41-
aborting();
42-
unsafe {
43-
::libc::abort(); // used for compat before 1.17
44-
}
28+
eprintln!("Rayon: detected unexpected panic; aborting");
29+
::std::process::abort();
4530
}
4631
}

0 commit comments

Comments
 (0)