diff --git a/gdnative-core/src/object/mod.rs b/gdnative-core/src/object/mod.rs index 2c1a92336..6219839a8 100644 --- a/gdnative-core/src/object/mod.rs +++ b/gdnative-core/src/object/mod.rs @@ -355,7 +355,7 @@ impl Ref { // Classes with NUL-bytes in their names can not exist let class_name = CString::new(class_name).ok()?; let ctor = (get_api().godot_get_class_constructor)(class_name.as_ptr())?; - let ptr = NonNull::new(ctor() as *mut sys::godot_object)?; + let ptr = NonNull::new(ctor().cast::())?; ::impl_from_maybe_ref_counted(ptr) } }