Disallow hidden references to mutable static

This commit is contained in:
Obei Sideg 2024-08-24 06:47:43 +03:00
parent d0985bb524
commit 74cab947f7
No known key found for this signature in database
GPG key ID: 14BF4B61362D0518
13 changed files with 203 additions and 133 deletions

View file

@ -35,6 +35,8 @@ macro raw_errln($tokens:tt) {
}
/// Signal handler installed for SIGSEGV
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
#[allow(static_mut_refs)]
extern "C" fn print_stack_trace(_: libc::c_int) {
const MAX_FRAMES: usize = 256;
// Reserve data segment so we don't have to malloc in a signal handler, which might fail