We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67540ec commit 9f17edeCopy full SHA for 9f17ede
tests/ui/process/signal-exit-status.rs
@@ -4,14 +4,16 @@
4
// ignore-windows
5
// ignore-fuchsia code returned as ZX_TASK_RETCODE_EXCEPTION_KILL, FIXME (#58590)
6
7
+#![feature(core_intrinsics)]
8
+
9
use std::env;
10
use std::process::Command;
11
12
pub fn main() {
13
let args: Vec<String> = env::args().collect();
14
if args.len() >= 2 && args[1] == "signal" {
- // Raise a segfault.
- unsafe { *(1 as *mut isize) = 0; }
15
+ // Raise an aborting signal without UB
16
+ core::intrinsics::abort();
17
} else {
18
let status = Command::new(&args[0]).arg("signal").status().unwrap();
19
assert!(status.code().is_none());
0 commit comments