about summary refs log tree commit diff
path: root/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs
blob: e583b12b1d7017ff514defac7411335908f1aec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Check that we eventually catch types of assoc const bounds
// (containing late-bound vars) that are ill-formed.
#![feature(associated_const_equality)]

trait Trait<T> {
    const K: T;
}

fn take(
    _: impl Trait<
        <<for<'a> fn(&'a str) -> &'a str as Project>::Out as Discard>::Out,
        K = { () }
    >,
) {}
//~^^^^^ ERROR implementation of `Project` is not general enough
//~^^^^ ERROR higher-ranked subtype error
//~| ERROR higher-ranked subtype error

trait Project { type Out; }
impl<T> Project for fn(T) -> T { type Out = T; }

trait Discard { type Out; }
impl<T: ?Sized> Discard for T { type Out = (); }

fn main() {}