Skip to content

Commit cfa763a

Browse files
bors[bot]chitoyuu
andauthored
Merge #1055
1055: Fix CI errors r=chitoyuu a=chitoyuu Co-authored-by: Chitose Yuuzaki <chitoyuu@potatoes.gay>
2 parents 1c6b364 + 3f4c27c commit cfa763a

File tree

14 files changed

+27
-26
lines changed

14 files changed

+27
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[workspace]
2+
resolver = "2"
23
members = [
34
"gdnative",
45
"gdnative-async",

bindings-generator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ heck = "0.4"
2121
miniserde = "0.1.16"
2222
proc-macro2 = "1"
2323
quote = "1"
24-
regex = { version = "1.5.5", default-features = false, features = ["std"] } # for security: https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html
24+
regex = { version = "1.5.5", default-features = false, features = ["std", "unicode-perl"] } # for security: https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html
2525
roxmltree = "0.18"
2626
syn = { version = "1", features = ["full", "extra-traits", "visit"] }
2727
unindent = "0.2.0"

bindings-generator/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl core::cmp::Ord for Enum {
178178

179179
impl core::cmp::PartialOrd for Enum {
180180
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
181-
core::cmp::PartialOrd::partial_cmp(&self.name, &other.name)
181+
Some(self.cmp(other))
182182
}
183183
}
184184

gdnative-async/src/method.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ impl<'a, C: NativeClass, A> Spawner<'a, C, A> {
157157
/// Consumes this `Spawner` and spawns a future returned by the closure. This indirection
158158
/// is necessary so that implementors of the `AsyncMethod` trait do not have to name their
159159
/// future types.
160+
#[allow(clippy::arc_with_non_send_sync)] // Stability concerns: part of public API
160161
pub fn spawn<F, R>(self, f: F)
161162
where
162163
F: FnOnce(Arc<Context>, TInstance<'_, C>, A) -> R,

gdnative-bindings/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(non_snake_case)]
55
#![allow(unused_unsafe)]
66
// False positives on generated drops that enforce lifetime
7-
#![allow(clippy::drop_copy)]
7+
#![allow(dropping_copy_types)]
88
// False positives on thread-safe singletons
99
#![allow(clippy::non_send_fields_in_send_ty)]
1010
// Disable non-critical lints for generated code

gdnative-core/src/export/class_registry.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ pub(crate) fn types_with_init_level(allow: InitLevel, deny: InitLevel) -> Vec<Co
9090
let registry = CLASS_REGISTRY.read();
9191
let mut list = registry
9292
.values()
93-
.filter_map(|class_info| {
94-
(class_info.init_level.intersects(allow) && !class_info.init_level.intersects(deny))
95-
.then(|| class_info.name.clone())
93+
.filter(|class_info| {
94+
class_info.init_level.intersects(allow) && !class_info.init_level.intersects(deny)
9695
})
96+
.map(|class_info| class_info.name.clone())
9797
.collect::<Vec<_>>();
9898

9999
list.sort_unstable();

gdnative-core/src/export/emplace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn take<T: NativeClass>() -> Option<T> {
4242
Err(any) => panic!(
4343
"expecting {} in the emplacement cell, got {:?} (this is a bug in the bindings)",
4444
class_registry::class_name_or_default::<T>(),
45-
any.type_id(),
45+
(*any).type_id(),
4646
),
4747
})
4848
}

gdnative-core/src/object/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ impl<T: GodotObject, Own: Ownership> Ord for Ref<T, Own> {
724724
impl<T: GodotObject, Own: Ownership> PartialOrd for Ref<T, Own> {
725725
#[inline]
726726
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
727-
self.ptr.as_non_null().partial_cmp(&other.ptr.as_non_null())
727+
Some(self.cmp(other))
728728
}
729729
}
730730

@@ -863,7 +863,7 @@ impl<'a, T: GodotObject, Own: Ownership> Copy for TRef<'a, T, Own> {}
863863
impl<'a, T: GodotObject, Own: Ownership> Clone for TRef<'a, T, Own> {
864864
#[inline]
865865
fn clone(&self) -> Self {
866-
TRef::new(self.obj)
866+
*self
867867
}
868868
}
869869

gdnative-core/src/object/raw.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<T: GodotObject> RawObject<T> {
7070
pub fn class_name(&self) -> String {
7171
let api = crate::private::get_api();
7272
let get_class_method = crate::private::ObjectMethodTable::get(api).get_class;
73-
let mut argument_buffer = [ptr::null() as *const libc::c_void; 0];
73+
let mut argument_buffer: [*const libc::c_void; 0] = [];
7474
let mut class_name = sys::godot_string::default();
7575
let ret_ptr = &mut class_name as *mut sys::godot_string;
7676

@@ -127,7 +127,7 @@ impl<T: GodotObject<Memory = RefCounted>> RawObject<T> {
127127
pub fn add_ref(&self) {
128128
let api = crate::private::get_api();
129129
let addref_method = crate::private::ReferenceMethodTable::get(api).reference;
130-
let mut argument_buffer = [ptr::null() as *const libc::c_void; 0];
130+
let mut argument_buffer: [*const libc::c_void; 0] = [];
131131
let mut ok = false;
132132
let ok_ptr = &mut ok as *mut bool;
133133

@@ -158,7 +158,7 @@ impl<T: GodotObject<Memory = RefCounted>> RawObject<T> {
158158
let api = crate::private::get_api();
159159
let unref_method = crate::private::ReferenceMethodTable::get(api).unreference;
160160

161-
let mut argument_buffer = [ptr::null() as *const libc::c_void; 0];
161+
let mut argument_buffer: [*const libc::c_void; 0] = [];
162162
let mut last_reference = false;
163163
let ret_ptr = &mut last_reference as *mut bool;
164164
(api.godot_method_bind_ptrcall)(
@@ -201,7 +201,7 @@ impl<T: GodotObject<Memory = RefCounted>> RawObject<T> {
201201
let api = crate::private::get_api();
202202
let init_method = crate::private::ReferenceMethodTable::get(api).init_ref;
203203

204-
let mut argument_buffer = [ptr::null() as *const libc::c_void; 0];
204+
let mut argument_buffer: [*const libc::c_void; 0] = [];
205205
let mut ok = false;
206206
let ret_ptr = &mut ok as *mut bool;
207207
(api.godot_method_bind_ptrcall)(
@@ -237,7 +237,7 @@ unsafe fn ptr_is_class(obj: *mut sys::godot_object, class_name: &str) -> bool {
237237
class_name.len() as _,
238238
);
239239

240-
let mut argument_buffer = [ptr::null() as *const libc::c_void; 1];
240+
let mut argument_buffer: [*const libc::c_void; 1] = [ptr::null(); 1];
241241
argument_buffer[0] = (&class_name) as *const _ as *const _;
242242

243243
let mut ret = false;

gdnative-derive/src/methods.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,7 @@ fn impl_gdnative_expose(ast: ItemImpl) -> (ItemImpl, ClassMethodExport) {
568568

569569
if is_export {
570570
use syn::{punctuated::Punctuated, Lit};
571-
let mut export_args =
572-
export_args.get_or_insert_with(ExportArgs::default);
571+
let export_args = export_args.get_or_insert_with(ExportArgs::default);
573572
export_args.is_old_syntax = is_old_syntax;
574573

575574
// Codes like #[macro(path, name = "value")] are accepted.

0 commit comments

Comments
 (0)