summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/type-arg-mismatch-due-to-impl-trait.rs
blob: ecfa5c69e2f038ed19bbc6264e017d0d839c4739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
trait Foo {
    type T;
    fn foo(&self, t: Self::T);
//~^ NOTE expected 0 type parameters
}

impl Foo for u32 {
    type T = ();

    fn foo(&self, t: impl Clone) {}
//~^ ERROR method `foo` has 1 type parameter but its trait declaration has 0 type parameters
//~| NOTE found 1 type parameter
//~| NOTE `impl Trait` introduces an implicit type parameter
}

fn main() {}