Skip to content

Fix FastCWakerState drop code

Sign in for the full log view
GitHub Actions / clippy succeeded Jul 27, 2024 in 0s

clippy

50 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 50
Note 0
Help 0

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check warning on line 28 in cglue/src/tests/simple/trait_groups.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> cglue/src/tests/simple/trait_groups.rs:28:23
   |
28 |     let _ = into_test(&a);
   |                       ^^ help: change this to: `a`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 33 in cglue/src/tests/simple/trait_defs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unsafe function's docs miss `# Safety` section

warning: unsafe function's docs miss `# Safety` section
  --> cglue/src/tests/simple/trait_defs.rs:33:5
   |
33 |     unsafe fn tf_1(&self);
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc

Check warning on line 189 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:189:31
    |
189 |         let bwaker = unsafe { transmute::<_, [usize; 2]>(waker) };
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<std::task::RawWaker, [usize; 2]>`
...
208 | const ORDER: CRawWakerOrder = { __order!() };
    |                                 ---------- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
    = note: this warning originates in the macro `__order` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 183 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:183:29
    |
183 |         let vtbl = unsafe { transmute(1 as *const ()) };
    |                             ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*const (), &std::task::RawWakerVTable>`
...
208 | const ORDER: CRawWakerOrder = { __order!() };
    |                                 ---------- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
    = note: this warning originates in the macro `__order` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 183 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a pointer type (`*const ()`) to a reference type (`&std::task::RawWakerVTable`)

warning: transmute from a pointer type (`*const ()`) to a reference type (`&std::task::RawWakerVTable`)
   --> cglue/src/task/mod.rs:183:29
    |
183 |         let vtbl = unsafe { transmute(1 as *const ()) };
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(1 as *const () as *const std::task::RawWakerVTable)`
...
208 | const ORDER: CRawWakerOrder = { __order!() };
    |                                 ---------- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ref
    = note: `#[warn(clippy::transmute_ptr_to_ref)]` on by default
    = note: this warning originates in the macro `__order` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 159 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:159:28
    |
159 |     let bvtbl_c = unsafe { transmute::<_, [u8; size_of::<RawWakerVTable>()]>(vtbl_c) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<task::CRawWakerVTable, [u8; 32]>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 158 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:158:26
    |
158 |     let bvtbl = unsafe { transmute::<_, [u8; size_of::<RawWakerVTable>()]>(vtbl) };
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<std::task::RawWakerVTable, [u8; 32]>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 148 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:148:13
    |
148 |             transmute(drop),
    |             ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*const (), unsafe fn(*const ())>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 147 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:147:13
    |
147 |             transmute(wake_by_ref),
    |             ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*const (), unsafe fn(*const ())>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 146 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:146:13
    |
146 |             transmute(wake),
    |             ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*const (), unsafe fn(*const ())>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 145 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:145:13
    |
145 |             transmute(clone),
    |             ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*const (), unsafe fn(*const ()) -> std::task::RawWaker>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 365 in cglue/src/task/sound.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cloning a `Waker` only to wake it

warning: cloning a `Waker` only to wake it
   --> cglue/src/task/sound.rs:365:17
    |
365 |                 cx.waker().clone().wake();
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `cx.waker().wake_by_ref()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#waker_clone_wake
    = note: `#[warn(clippy::waker_clone_wake)]` on by default

Check warning on line 339 in cglue/src/task/sound.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression borrows a value the compiler would automatically borrow

warning: this expression borrows a value the compiler would automatically borrow
   --> cglue/src/task/sound.rs:339:23
    |
339 |             (unsafe { &mut self.get_unchecked_mut().f })(cx)
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.get_unchecked_mut().f`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 138 in cglue/src/task/sound.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/sound.rs:138:44
    |
138 |         unsafe { Self::from_raw(core::mem::transmute(waker)) }
    |                                            ^^^^^^^^^ help: consider adding missing annotations: `transmute::<std::task::Waker, std::task::RawWaker>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 128 in cglue/src/task/sound.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`)

warning: casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`)
   --> cglue/src/task/sound.rs:128:61
    |
128 |             raw: unsafe { (self.clone_adapter)(self.data(), self.vtable().clone as *const ()) },
    |                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.vtable().clone`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 117 in cglue/src/task/sound.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`)

warning: casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`)
   --> cglue/src/task/sound.rs:117:40
    |
117 |         unsafe { (other_adapter)(data, drop as *const ()) };
    |                                        ^^^^^^^^^^^^^^^^^ help: try: `drop`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default

Check warning on line 95 in cglue/src/task/sound.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unsafe function's docs miss `# Safety` section

warning: unsafe function's docs miss `# Safety` section
  --> cglue/src/task/sound.rs:95:5
   |
95 |     pub unsafe fn from_raw(raw: RawWaker) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
   = note: `#[warn(clippy::missing_safety_doc)]` on by default

Check warning on line 153 in cglue/src/trait_group.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> cglue/src/trait_group.rs:153:9
    |
153 |         &self.vtbl
    |         ^^^^^^^^^^ help: change this to: `self.vtbl`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 244 in cglue/src/slice.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> cglue/src/slice.rs:244:35
    |
244 |             _lifetime: PhantomData::default(),
    |                                   ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs

Check warning on line 234 in cglue/src/slice.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `default` to create a unit struct

warning: use of `default` to create a unit struct
   --> cglue/src/slice.rs:234:35
    |
234 |             _lifetime: PhantomData::default(),
    |                                   ^^^^^^^^^^^ help: remove this call to `default`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
    = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default

Check warning on line 76 in cglue/src/iter.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
  --> cglue/src/iter.rs:76:39
   |
76 |         let func = unsafe { std::mem::transmute::<_, _>(func) };
   |                                       ^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<extern "C" fn(&mut I, &mut std::mem::MaybeUninit<T>) -> i32, for<'a, 'b> extern "C" fn(&'a mut trait_group::c_void, &'b mut std::mem::MaybeUninit<T>) -> i32>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations

Check warning on line 49 in cglue/src/callback.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
  --> cglue/src/callback.rs:49:33
   |
49 |                 func: std::mem::transmute(self.func),
   |                                 ^^^^^^^^^ help: consider adding missing annotations: `transmute::<for<'a> extern "C" fn(&'a mut T, F) -> bool, for<'a> extern "C" fn(&'a mut trait_group::c_void, F) -> bool>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
   = note: `#[warn(clippy::missing_transmute_annotations)]` on by default

Check warning on line 189 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:189:31
    |
189 |         let bwaker = unsafe { transmute::<_, [usize; 2]>(waker) };
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<std::task::RawWaker, [usize; 2]>`
...
208 | const ORDER: CRawWakerOrder = { __order!() };
    |                                 ---------- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
    = note: this warning originates in the macro `__order` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 183 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute used without annotations

warning: transmute used without annotations
   --> cglue/src/task/mod.rs:183:29
    |
183 |         let vtbl = unsafe { transmute(1 as *const ()) };
    |                             ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*const (), &std::task::RawWakerVTable>`
...
208 | const ORDER: CRawWakerOrder = { __order!() };
    |                                 ---------- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
    = note: this warning originates in the macro `__order` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 183 in cglue/src/task/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a pointer type (`*const ()`) to a reference type (`&std::task::RawWakerVTable`)

warning: transmute from a pointer type (`*const ()`) to a reference type (`&std::task::RawWakerVTable`)
   --> cglue/src/task/mod.rs:183:29
    |
183 |         let vtbl = unsafe { transmute(1 as *const ()) };
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*(1 as *const () as *const std::task::RawWakerVTable)`
...
208 | const ORDER: CRawWakerOrder = { __order!() };
    |                                 ---------- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ref
    = note: `#[warn(clippy::transmute_ptr_to_ref)]` on by default
    = note: this warning originates in the macro `__order` (in Nightly builds, run with -Z macro-backtrace for more info)