File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -313,20 +313,21 @@ impl Callable {
313313 R : ToGodot ,
314314 S : Into < CowStr > ,
315315 {
316- Self :: from_fn_wrapper_with_thread (
317- name ,
318- rust_function ,
319- linked_object_id ,
320- # [ cfg ( safeguards_balanced ) ]
321- Some ( std :: thread :: current ( ) . id ( ) ) ,
322- )
316+ let thread_id = if cfg ! ( safeguards_balanced ) {
317+ Some ( std :: thread :: current ( ) . id ( ) )
318+ } else {
319+ None // Thread not checked.
320+ } ;
321+
322+ Self :: from_fn_wrapper_with_thread ( name , rust_function , linked_object_id , thread_id )
323323 }
324324
325325 fn from_fn_wrapper_with_thread < F , R , S > (
326326 name : S ,
327327 rust_function : F ,
328328 linked_object_id : Option < InstanceId > ,
329- #[ cfg( safeguards_balanced) ] thread_id : Option < std:: thread:: ThreadId > ,
329+ // No #[cfg] on param; would be converted to (invalid) #[doc(cfg)].
330+ _thread_id : Option < std:: thread:: ThreadId > ,
330331 ) -> Self
331332 where
332333 F : FnMut ( & [ & Variant ] ) -> R ,
@@ -340,7 +341,7 @@ impl Callable {
340341 name,
341342 name_cached : OnceLock :: new ( ) ,
342343 #[ cfg( safeguards_balanced) ]
343- thread_id,
344+ thread_id : _thread_id ,
344345 linked_object_id,
345346 } ;
346347
You can’t perform that action at this time.
0 commit comments