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:: ClassName ;
16
16
use crate :: obj:: { bounds, Bounds , Gd , GodotClass , InstanceId , RawGd } ;
17
17
use crate :: sys;
@@ -177,6 +177,7 @@ where
177
177
}
178
178
}
179
179
180
+ #[ cfg( checks_at_least = "balanced" ) ]
180
181
pub ( crate ) fn ensure_object_alive (
181
182
instance_id : InstanceId ,
182
183
old_object_ptr : sys:: GDExtensionObjectPtr ,
@@ -197,7 +198,7 @@ pub(crate) fn ensure_object_alive(
197
198
) ;
198
199
}
199
200
200
- #[ cfg( debug_assertions ) ]
201
+ #[ cfg( checks_at_least = "paranoid" ) ]
201
202
pub ( crate ) fn ensure_object_inherits ( derived : ClassName , base : ClassName , instance_id : InstanceId ) {
202
203
if derived == base
203
204
|| 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
212
213
)
213
214
}
214
215
215
- #[ cfg( debug_assertions ) ]
216
+ #[ cfg( checks_at_least = "paranoid" ) ]
216
217
pub ( crate ) fn ensure_binding_not_null < T > ( binding : sys:: GDExtensionClassInstancePtr )
217
218
where
218
219
T : GodotClass + Bounds < Declarer = bounds:: DeclUser > ,
@@ -240,7 +241,7 @@ where
240
241
// Implementation of this file
241
242
242
243
/// Checks if `derived` inherits from `base`, using a cache for _successful_ queries.
243
- #[ cfg( debug_assertions ) ]
244
+ #[ cfg( checks_at_least = "paranoid" ) ]
244
245
fn is_derived_base_cached ( derived : ClassName , base : ClassName ) -> bool {
245
246
use std:: collections:: HashSet ;
246
247
0 commit comments