Skip to content

Commit c439385

Browse files
committed
redo it
1 parent 81b688a commit c439385

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/byondapi-rs/src/runtime.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use crate::static_global::byond;
22
use std::ffi::CString;
33

4-
/// Immediately returns a runtime from this context
4+
/// Immediately returns a runtime from this context.
55
///
6-
/// # WARNING, THIS WILL NOT CALL DROP ON THINGS, YOU MUST DROP EVERYTHING BEFORE YOU CALL THIS FUNCTION
6+
/// ## This function will immediately longjump to byond, Drop destructors or catch_unwind will be ignored.
7+
/// ## Make sure you drop everything before you call this.
78
pub unsafe fn byond_runtime<S: Into<Vec<u8>>>(message: S) -> ! {
89
let c_str = CString::new(message.into()).unwrap();
910
unsafe { byond().Byond_CRASH(c_str.as_ptr()) };
10-
panic!()
11+
unreachable!()
1112
}

0 commit comments

Comments
 (0)