8
8
//! Runtime checks and inspection of Godot classes.
9
9
10
10
use crate :: builtin:: { GString , StringName , Variant , VariantType } ;
11
- #[ cfg( debug_assertions ) ]
11
+ #[ cfg( checks_at_least = "paranoid" ) ]
12
12
use crate :: classes:: { ClassDb , Object } ;
13
13
use crate :: meta:: CallContext ;
14
- #[ cfg( debug_assertions ) ]
14
+ #[ cfg( checks_at_least = "paranoid" ) ]
15
15
use crate :: meta:: ClassId ;
16
16
use crate :: obj:: { bounds, Bounds , Gd , GodotClass , InstanceId , RawGd , Singleton } ;
17
17
use crate :: sys;
@@ -191,6 +191,7 @@ where
191
191
Gd :: < T > :: from_obj_sys ( object_ptr)
192
192
}
193
193
194
+ #[ cfg( checks_at_least = "balanced" ) ]
194
195
pub ( crate ) fn ensure_object_alive (
195
196
instance_id : InstanceId ,
196
197
old_object_ptr : sys:: GDExtensionObjectPtr ,
@@ -211,7 +212,7 @@ pub(crate) fn ensure_object_alive(
211
212
) ;
212
213
}
213
214
214
- #[ cfg( debug_assertions ) ]
215
+ #[ cfg( checks_at_least = "paranoid" ) ]
215
216
pub ( crate ) fn ensure_object_inherits ( derived : ClassId , base : ClassId , instance_id : InstanceId ) {
216
217
if derived == base
217
218
|| base == Object :: class_id ( ) // for Object base, anything inherits by definition
@@ -226,7 +227,7 @@ pub(crate) fn ensure_object_inherits(derived: ClassId, base: ClassId, instance_i
226
227
)
227
228
}
228
229
229
- #[ cfg( debug_assertions ) ]
230
+ #[ cfg( checks_at_least = "paranoid" ) ]
230
231
pub ( crate ) fn ensure_binding_not_null < T > ( binding : sys:: GDExtensionClassInstancePtr )
231
232
where
232
233
T : GodotClass + Bounds < Declarer = bounds:: DeclUser > ,
@@ -254,7 +255,7 @@ where
254
255
// Implementation of this file
255
256
256
257
/// Checks if `derived` inherits from `base`, using a cache for _successful_ queries.
257
- #[ cfg( debug_assertions ) ]
258
+ #[ cfg( checks_at_least = "paranoid" ) ]
258
259
fn is_derived_base_cached ( derived : ClassId , base : ClassId ) -> bool {
259
260
use std:: collections:: HashSet ;
260
261
0 commit comments