88//! Runtime checks and inspection of Godot classes.
99
1010use crate :: builtin:: { GString , StringName , Variant , VariantType } ;
11- #[ cfg( debug_assertions ) ]
11+ #[ cfg( checks_at_least = "paranoid" ) ]
1212use crate :: classes:: { ClassDb , Object } ;
1313use crate :: meta:: CallContext ;
14- #[ cfg( debug_assertions ) ]
14+ #[ cfg( checks_at_least = "paranoid" ) ]
1515use crate :: meta:: ClassName ;
1616use crate :: obj:: { bounds, Bounds , Gd , GodotClass , InstanceId , RawGd } ;
1717use crate :: sys;
@@ -177,6 +177,7 @@ where
177177 }
178178}
179179
180+ #[ cfg( checks_at_least = "balanced" ) ]
180181pub ( crate ) fn ensure_object_alive (
181182 instance_id : InstanceId ,
182183 old_object_ptr : sys:: GDExtensionObjectPtr ,
@@ -197,7 +198,7 @@ pub(crate) fn ensure_object_alive(
197198 ) ;
198199}
199200
200- #[ cfg( debug_assertions ) ]
201+ #[ cfg( checks_at_least = "paranoid" ) ]
201202pub ( crate ) fn ensure_object_inherits ( derived : ClassName , base : ClassName , instance_id : InstanceId ) {
202203 if derived == base
203204 || base == Object :: class_name ( ) // for Object base, anything inherits by definition
@@ -212,7 +213,7 @@ pub(crate) fn ensure_object_inherits(derived: ClassName, base: ClassName, instan
212213 )
213214}
214215
215- #[ cfg( debug_assertions ) ]
216+ #[ cfg( checks_at_least = "paranoid" ) ]
216217pub ( crate ) fn ensure_binding_not_null < T > ( binding : sys:: GDExtensionClassInstancePtr )
217218where
218219 T : GodotClass + Bounds < Declarer = bounds:: DeclUser > ,
@@ -240,7 +241,7 @@ where
240241// Implementation of this file
241242
242243/// Checks if `derived` inherits from `base`, using a cache for _successful_ queries.
243- #[ cfg( debug_assertions ) ]
244+ #[ cfg( checks_at_least = "paranoid" ) ]
244245fn is_derived_base_cached ( derived : ClassName , base : ClassName ) -> bool {
245246 use std:: collections:: HashSet ;
246247
0 commit comments