summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait/generics-mismatch.rs
blob: 9259ca193d1de79e085334798fe1a2cfbdcac029 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// revisions: current next

#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]

struct U;

trait Foo {
    fn bar(&self) -> impl Sized;
}

impl Foo for U {
    fn bar<T>(&self) {}
    //~^ ERROR method `bar` has 1 type parameter but its trait declaration has 0 type parameters
}

fn main() {
    U.bar();
}