Skip to content

Cleanup task module #269

Cleanup task module

Cleanup task module #269

GitHub Actions / clippy failed Jul 26, 2024 in 1s

clippy

4 errors, 52 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 4
Warning 52
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 failure on line 6 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/internal_macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied

error[E0599]: the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied
   --> cglue/src/task/sound.rs:143:43
    |
143 | #[cfg_attr(feature = "abi_stable", derive(::abi_stable::StableAbi))]
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^ associated item cannot be called on `GetTypeLayoutCtor<CRawWakerOrder>` due to unsatisfied trait bounds
    |
   ::: cglue/src/task/mod.rs:41:1
    |
41  | struct CRawWakerOrder {
    | --------------------- doesn't satisfy `task::CRawWakerOrder: abi_stable::StableAbi`
    |
    = note: the following trait bounds were not satisfied:
            `task::CRawWakerOrder: abi_stable::StableAbi`
note: the trait `abi_stable::StableAbi` must be implemented
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/abi_stability/stable_abi_trait.rs:44:1
    |
44  | pub unsafe trait StableAbi: GetStaticEquivalent_ {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::_sabi_type_layouts` which comes from the expansion of the derive macro `::abi_stable::StableAbi` (in Nightly builds, run with -Z macro-backtrace for more info)

Check failure on line 6 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/internal_macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied

error[E0599]: the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied
  --> cglue/src/task/sound.rs:20:43
   |
20 | #[cfg_attr(feature = "abi_stable", derive(::abi_stable::StableAbi))]
   |                                           ^^^^^^^^^^^^^^^^^^^^^^^ associated item cannot be called on `GetTypeLayoutCtor<CRawWakerOrder>` due to unsatisfied trait bounds
   |
  ::: cglue/src/task/mod.rs:41:1
   |
41 | struct CRawWakerOrder {
   | --------------------- doesn't satisfy `task::CRawWakerOrder: abi_stable::StableAbi`
   |
   = note: the following trait bounds were not satisfied:
           `task::CRawWakerOrder: abi_stable::StableAbi`
note: the trait `abi_stable::StableAbi` must be implemented
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/abi_stability/stable_abi_trait.rs:44:1
   |
44 | pub unsafe trait StableAbi: GetStaticEquivalent_ {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the macro `$crate::_sabi_type_layouts` which comes from the expansion of the derive macro `::abi_stable::StableAbi` (in Nightly builds, run with -Z macro-backtrace for more info)

Check failure on line 6 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/internal_macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied

error[E0599]: the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied
   --> cglue/src/task/sound.rs:143:43
    |
143 | #[cfg_attr(feature = "abi_stable", derive(::abi_stable::StableAbi))]
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^ associated item cannot be called on `GetTypeLayoutCtor<CRawWakerOrder>` due to unsatisfied trait bounds
    |
   ::: cglue/src/task/mod.rs:41:1
    |
41  | struct CRawWakerOrder {
    | --------------------- doesn't satisfy `task::CRawWakerOrder: abi_stable::StableAbi`
    |
    = note: the following trait bounds were not satisfied:
            `task::CRawWakerOrder: abi_stable::StableAbi`
note: the trait `abi_stable::StableAbi` must be implemented
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/abi_stability/stable_abi_trait.rs:44:1
    |
44  | pub unsafe trait StableAbi: GetStaticEquivalent_ {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `$crate::_sabi_type_layouts` which comes from the expansion of the derive macro `::abi_stable::StableAbi` (in Nightly builds, run with -Z macro-backtrace for more info)

Check failure on line 6 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/internal_macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied

error[E0599]: the associated item `STABLE_ABI` exists for struct `GetTypeLayoutCtor<CRawWakerOrder>`, but its trait bounds were not satisfied
  --> cglue/src/task/sound.rs:20:43
   |
20 | #[cfg_attr(feature = "abi_stable", derive(::abi_stable::StableAbi))]
   |                                           ^^^^^^^^^^^^^^^^^^^^^^^ associated item cannot be called on `GetTypeLayoutCtor<CRawWakerOrder>` due to unsatisfied trait bounds
   |
  ::: cglue/src/task/mod.rs:41:1
   |
41 | struct CRawWakerOrder {
   | --------------------- doesn't satisfy `task::CRawWakerOrder: abi_stable::StableAbi`
   |
   = note: the following trait bounds were not satisfied:
           `task::CRawWakerOrder: abi_stable::StableAbi`
note: the trait `abi_stable::StableAbi` must be implemented
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/abi_stable-0.10.4/src/abi_stability/stable_abi_trait.rs:44:1
   |
44 | pub unsafe trait StableAbi: GetStaticEquivalent_ {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the macro `$crate::_sabi_type_layouts` which comes from the expansion of the derive macro `::abi_stable::StableAbi` (in Nightly builds, run with -Z macro-backtrace for more info)

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary braces around assigned value

warning: unnecessary braces around assigned value
   --> cglue/src/task/mod.rs:205:31
    |
205 | const ORDER: CRawWakerOrder = { __order!() };
    |                               ^^          ^^
    |
    = note: `#[warn(unused_braces)]` on by default
help: remove these braces
    |
205 - const ORDER: CRawWakerOrder = { __order!() };
205 + const ORDER: CRawWakerOrder = __order!();
    |

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

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary braces around assigned value

warning: unnecessary braces around assigned value
   --> cglue/src/task/mod.rs:205:31
    |
205 | const ORDER: CRawWakerOrder = { __order!() };
    |                               ^^          ^^
    |
    = note: `#[warn(unused_braces)]` on by default
help: remove these braces
    |
205 - const ORDER: CRawWakerOrder = { __order!() };
205 + const ORDER: CRawWakerOrder = __order!();
    |

Check warning on line 155 in cglue-bindgen/src/main.rs

See this annotation in the file changed.

@github-actions 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

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-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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 208 in cglue-gen/src/trait_groups.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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