mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
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:
parent
0cb41b7a07
commit
41659ec394
1 changed files with 0 additions and 20 deletions
|
@ -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!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue