clippy
61 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 61 |
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
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
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 222 in cglue/src/task/mod.rs
github-actions / clippy
cloning a `Waker` only to wake it
warning: cloning a `Waker` only to wake it
--> cglue/src/task/mod.rs:222:17
|
222 | 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 196 in cglue/src/task/mod.rs
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/mod.rs:196:23
|
196 | (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 150 in cglue/src/task/mod.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> cglue/src/task/mod.rs:150:44
|
150 | 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 113 in cglue/src/task/mod.rs
github-actions / clippy
unsafe function's docs miss `# Safety` section
warning: unsafe function's docs miss `# Safety` section
--> cglue/src/task/mod.rs:113:5
|
113 | pub unsafe fn from_raw(raw: &'a 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 83 in cglue/src/task/mod.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> cglue/src/task/mod.rs:83:28
|
83 | let waker = core::mem::transmute(waker.clone());
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<std::task::Waker, task::OpaqueRawWaker>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
Check warning on line 153 in cglue/src/trait_group.rs
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
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
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
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 (), &'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
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 (), 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 150 in cglue/src/task/mod.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> cglue/src/task/mod.rs:150:44
|
150 | 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 113 in cglue/src/task/mod.rs
github-actions / clippy
unsafe function's docs miss `# Safety` section
warning: unsafe function's docs miss `# Safety` section
--> cglue/src/task/mod.rs:113:5
|
113 | pub unsafe fn from_raw(raw: &'a 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 83 in cglue/src/task/mod.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> cglue/src/task/mod.rs:83:28
|
83 | let waker = core::mem::transmute(waker.clone());
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<std::task::Waker, task::OpaqueRawWaker>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
Check warning on line 153 in cglue/src/trait_group.rs
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
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
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
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 (), &'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
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 (), 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 155 in cglue-bindgen/src/main.rs
github-actions / clippy
this `as_str` is redundant and can be removed as the method immediately following exists on `String` too
warning: this `as_str` is redundant and can be removed as the method immediately following exists on `String` too
--> cglue-bindgen/src/main.rs:155:31
|
155 | file.write_all(output.as_str().as_bytes())?;
| ^^^^^^^^^^^^^^^^^ help: try: `as_bytes`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_as_str
= note: `#[warn(clippy::redundant_as_str)]` on by default
Check warning on line 127 in cglue-bindgen/src/main.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> cglue-bindgen/src/main.rs:127:18
|
127 | cmd.args(&["run", "nightly", "cbindgen"]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["run", "nightly", "cbindgen"]`
|
= 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 106 in cglue-bindgen/src/types.rs
github-actions / clippy
iterating on a map's values
warning: iterating on a map's values
--> cglue-bindgen/src/types.rs:104:9
|
104 | / Self::get_map()
105 | | .into_iter()
106 | | .map(|(_, v)| (v.ty_prefix, v))
| |___________________________________________^ help: try: `Self::get_map().into_values().map(|v| (v.ty_prefix, v))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
Check warning on line 53 in cglue-bindgen/src/types.rs
github-actions / clippy
iterating on a map's values
warning: iterating on a map's values
--> cglue-bindgen/src/types.rs:51:9
|
51 | / Self::get_map()
52 | | .into_iter()
53 | | .map(|(_, v)| (v.ty_prefix, v))
| |___________________________________________^ help: try: `Self::get_map().into_values().map(|v| (v.ty_prefix, v))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
Check warning on line 208 in cglue-gen/src/trait_groups.rs
github-actions / clippy
replacing an `Option` with `None`
warning: replacing an `Option` with `None`
--> cglue-gen/src/trait_groups.rs:208:37
|
208 | let leading_colon = std::mem::replace(&mut vtbl.path.leading_colon, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `vtbl.path.leading_colon.take()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none
= note: `#[warn(clippy::mem_replace_option_with_none)]` on by default