clippy: Fix a bunch of warnings in script (#32680)

This is just a portion of the errors that are remaining to be fixed.
This commit is contained in:
Martin Robinson 2024-07-04 13:40:23 +02:00 committed by GitHub
parent 93fdb8263d
commit 26624a109f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 150 additions and 113 deletions

View file

@ -418,6 +418,10 @@ where
/// without causing conflicts , unexpected behavior.
/// <https://github.com/servo/mozjs/blob/main/mozjs-sys/mozjs/js/public/ArrayBuffer.h#L89>
unsafe extern "C" fn free_func(_contents: *mut c_void, free_user_data: *mut c_void) {
// Clippy warns about "creating a `Arc` from a void raw pointer" here, but suggests
// the exact same line to fix it. Doing the cast is tricky because of the use of
// a generic type in this parameter.
#[allow(clippy::from_raw_with_void_ptr)]
let _ = Arc::from_raw(free_user_data as *const _);
}