summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-inherent-types/issue-109789.rs
blob: 0b5ba7d1fb55da493ca4375156e4ad1d960ac82e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]

struct Foo<T>(T);

impl Foo<fn(&'static ())> {
    type Assoc = u32;
}

trait Other {}
impl Other for u32 {}

// FIXME(inherent_associated_types): Avoid emitting two diagnostics (they only differ in span).
// FIXME(inherent_associated_types): Enhancement: Spruce up the diagnostic by saying something like
// "implementation is not general enough" as is done for traits via
// `try_report_trait_placeholder_mismatch`.

fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {}
//~^ ERROR mismatched types
//~| ERROR mismatched types

fn main() {}