rust-clippy/tests/ui/impl_trait_in_params.stderr

48 lines
1.6 KiB
Text

error: `impl Trait` used as a function parameter
--> $DIR/impl_trait_in_params.rs:9:13
|
LL | pub fn a(_: impl Trait) {}
| ^^^^^^^^^^
|
= note: `-D clippy::impl-trait-in-params` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::impl_trait_in_params)]`
help: add a type parameter
|
LL | pub fn a<{ /* Generic name */ }: Trait>(_: impl Trait) {}
| +++++++++++++++++++++++++++++++
error: `impl Trait` used as a function parameter
--> $DIR/impl_trait_in_params.rs:11:29
|
LL | pub fn c<C: Trait>(_: C, _: impl Trait) {}
| ^^^^^^^^^^
|
help: add a type parameter
|
LL | pub fn c<C: Trait, { /* Generic name */ }: Trait>(_: C, _: impl Trait) {}
| +++++++++++++++++++++++++++++++
error: `impl Trait` used as a function parameter
--> $DIR/impl_trait_in_params.rs:36:17
|
LL | pub fn h(_: impl Trait) {}
| ^^^^^^^^^^
|
help: add a type parameter
|
LL | pub fn h<{ /* Generic name */ }: Trait>(_: impl Trait) {}
| +++++++++++++++++++++++++++++++
error: `impl Trait` used as a function parameter
--> $DIR/impl_trait_in_params.rs:39:45
|
LL | pub fn k<K: AnotherTrait<u32>>(_: K, _: impl AnotherTrait<u32>) {}
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: add a type parameter
|
LL | pub fn k<K: AnotherTrait<u32>, { /* Generic name */ }: AnotherTrait<u32>>(_: K, _: impl AnotherTrait<u32>) {}
| +++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 4 previous errors