File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -169,10 +169,11 @@ pub fn bind(attr: TokenStream, item: TokenStream) -> TokenStream {
169169 )
170170 }
171171 , & [ error_string] ) . unwrap( ) ;
172+ :: byondapi:: value:: ByondValue :: null( )
172173 }
173174 } else {
174175 quote ! {
175- :: byondapi:: runtime:: byond_runtime( error_string) ;
176+ :: byondapi:: runtime:: byond_runtime( error_string)
176177 }
177178 } ;
178179
@@ -184,8 +185,8 @@ pub fn bind(attr: TokenStream, item: TokenStream) -> TokenStream {
184185 Ok ( val) => val,
185186 Err ( e) => {
186187 let error_string = :: std:: format!( "{e:?}" ) ;
188+ :: std:: mem:: drop( e) ;
187189 #crash_syntax
188- :: byondapi:: value:: ByondValue :: null( )
189190 }
190191 }
191192
@@ -324,10 +325,11 @@ pub fn bind_raw_args(attr: TokenStream, item: TokenStream) -> TokenStream {
324325 )
325326 }
326327 , & [ error_string] ) . unwrap( ) ;
328+ :: byondapi:: value:: ByondValue :: null( )
327329 }
328330 } else {
329331 quote ! {
330- :: byondapi:: runtime:: byond_runtime( error_string) ;
332+ :: byondapi:: runtime:: byond_runtime( error_string)
331333 }
332334 } ;
333335
@@ -339,8 +341,8 @@ pub fn bind_raw_args(attr: TokenStream, item: TokenStream) -> TokenStream {
339341 Ok ( val) => val,
340342 Err ( e) => {
341343 let error_string = :: std:: format!( "{e:?}" ) ;
344+ :: std:: mem:: drop( e) ;
342345 #crash_syntax
343- :: byondapi:: value:: ByondValue :: null( )
344346 }
345347 }
346348 }
Original file line number Diff line number Diff line change 11use crate :: static_global:: byond;
22use std:: ffi:: CString ;
33
4- pub fn byond_runtime < S : Into < Vec < u8 > > > ( message : S ) {
4+ /// 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
7+ pub unsafe fn byond_runtime < S : Into < Vec < u8 > > > ( message : S ) -> ! {
58 let c_str = CString :: new ( message. into ( ) ) . unwrap ( ) ;
6- unsafe { byond ( ) . Byond_CRASH ( c_str. as_ptr ( ) ) }
9+ unsafe { byond ( ) . Byond_CRASH ( c_str. as_ptr ( ) ) } ;
10+ panic ! ( )
711}
You can’t perform that action at this time.
0 commit comments