Change macos version in workflows #268
clippy
60 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 60 |
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
= note: `#[warn(clippy::missing_safety_doc)]` on by default
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 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
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 4 in cglue/src/tests/extra/forward.rs
github-actions / clippy
trait `ForwardMe` is never used
warning: trait `ForwardMe` is never used
--> cglue/src/tests/extra/forward.rs:4:7
|
4 | trait ForwardMe {
| ^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
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 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
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 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
Check warning on line 655 in cglue-gen/src/generics.rs
github-actions / clippy
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> cglue-gen/src/generics.rs:655:35
|
655 | self.generic_types.extend(types.into_iter());
| ^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `types`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/iter/traits/collect.rs:448:18
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 647 in cglue-gen/src/generics.rs
github-actions / clippy
use of `expect` followed by a function call
warning: use of `expect` followed by a function call
--> cglue-gen/src/generics.rs:647:14
|
647 | .expect(&format!("Invalid types provided: {}", typestr));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid types provided: {}", typestr))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
Check warning on line 637 in cglue-gen/src/generics.rs
github-actions / clippy
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> cglue-gen/src/generics.rs:637:35
|
637 | self.generic_types.extend(types.into_iter());
| ^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `types`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/iter/traits/collect.rs:448:18
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 628 in cglue-gen/src/generics.rs
github-actions / clippy
use of `expect` followed by a function call
warning: use of `expect` followed by a function call
--> cglue-gen/src/generics.rs:628:18
|
628 | .expect(&format!("Invalid types provided: {}", typestr));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Invalid types provided: {}", typestr))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` on by default
Check warning on line 191 in cglue-gen/src/generics.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> cglue-gen/src/generics.rs:191:9
|
191 | other.gen_remaps = self.gen_remaps.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `other.gen_remaps.clone_from(&self.gen_remaps)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check warning on line 1642 in cglue-gen/src/func.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> cglue-gen/src/func.rs:1642:17
|
1642 | ret.injected_ret_tmp_static = ty_static.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `ret.injected_ret_tmp_static.clone_from(ty_static)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check warning on line 1594 in cglue-gen/src/func.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> cglue-gen/src/func.rs:1594:29
|
1594 | ... ty_cast.lifetime = lifetime_cast.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `ty_cast.lifetime.clone_from(&lifetime_cast)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check warning on line 1590 in cglue-gen/src/func.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> cglue-gen/src/func.rs:1590:21
|
1590 | ty.lifetime = lifetime.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `ty.lifetime.clone_from(&lifetime)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
Check warning on line 634 in cglue-gen/src/func.rs
github-actions / clippy
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> cglue-gen/src/func.rs:634:30
|
634 | orig_args.extend(sig.inputs.into_iter());
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `sig.inputs`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/iter/traits/collect.rs:448:18
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` 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
Check warning on line 655 in cglue-gen/src/generics.rs
github-actions / clippy
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> cglue-gen/src/generics.rs:655:35
|
655 | self.generic_types.extend(types.into_iter());
| ^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `types`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/iter/traits/collect.rs:448:18
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion