From 542c1487c921fc29cad0b88109129fde4f02c4b0 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 21 Sep 2024 12:28:03 +0200 Subject: [PATCH] chore: allow static mut ref (#11083) --- crates/cli/util/src/sigsegv_handler.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/cli/util/src/sigsegv_handler.rs b/crates/cli/util/src/sigsegv_handler.rs index 9e6833b75..e54f0669a 100644 --- a/crates/cli/util/src/sigsegv_handler.rs +++ b/crates/cli/util/src/sigsegv_handler.rs @@ -47,6 +47,8 @@ extern "C" fn print_stack_trace(_: libc::c_int) { // Reserve data segment so we don't have to malloc in a signal handler, which might fail // in incredibly undesirable and unexpected ways due to e.g. the allocator deadlocking static mut STACK_TRACE: [*mut libc::c_void; MAX_FRAMES] = [ptr::null_mut(); MAX_FRAMES]; + #[allow(static_mut_refs)] + // TODO: remove static mut; this will become a hard error in edition 2024 let stack = unsafe { // Collect return addresses let depth = libc::backtrace(STACK_TRACE.as_mut_ptr(), MAX_FRAMES as i32);