We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81b688a commit c439385Copy full SHA for c439385
crates/byondapi-rs/src/runtime.rs
@@ -1,11 +1,12 @@
1
use crate::static_global::byond;
2
use std::ffi::CString;
3
4
-/// Immediately returns a runtime from this context
+/// Immediately returns a runtime from this context.
5
///
6
-/// # WARNING, THIS WILL NOT CALL DROP ON THINGS, YOU MUST DROP EVERYTHING BEFORE YOU CALL THIS FUNCTION
+/// ## 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.
8
pub unsafe fn byond_runtime<S: Into<Vec<u8>>>(message: S) -> ! {
9
let c_str = CString::new(message.into()).unwrap();
10
unsafe { byond().Byond_CRASH(c_str.as_ptr()) };
- panic!()
11
+ unreachable!()
12
}
0 commit comments