Remove unneeded roc_panic extern in tests

We stub roc_panic to SJ/LJ-style exceptions in llvm tests, so this is
not needed.
This commit is contained in:
Ayaz Hafiz 2022-11-24 14:56:44 -06:00
parent 0cb41b7a07
commit 41659ec394
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -1,8 +1,5 @@
use core::ffi::c_void;
use roc_mono::ir::CrashTag;
use roc_std::RocStr;
/// # Safety
/// The Roc application needs this.
#[no_mangle]
@ -35,20 +32,3 @@ pub unsafe fn roc_realloc(
pub unsafe fn roc_dealloc(c_ptr: *mut c_void, _alignment: u32) {
libc::free(c_ptr)
}
/// # Safety
/// The Roc application needs this.
#[no_mangle]
pub unsafe fn roc_panic(msg: &RocStr, tag_id: u32) {
match CrashTag::try_from(tag_id) {
Ok(CrashTag::Roc) => {
eprintln!("Roc hit a panic: {}", msg);
std::process::exit(1);
}
Ok(CrashTag::User) => {
eprintln!("User panic: {}", msg);
std::process::exit(1);
}
Err(_) => unreachable!(),
}
}