summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/impl_trait_in_params.rs
blob: 07560101a4167cb2047d8ad33a91991cbe773e7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![allow(unused)]
#![warn(clippy::impl_trait_in_params)]

pub trait Trait {}
pub trait AnotherTrait<T> {}

// Should warn
pub fn a(_: impl Trait) {}
pub fn c<C: Trait>(_: C, _: impl Trait) {}
fn d(_: impl AnotherTrait<u32>) {}

// Shouldn't warn

pub fn b<B: Trait>(_: B) {}
fn e<T: AnotherTrait<u32>>(_: T) {}

fn main() {}