summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/higher_kinded_params2.rs
blob: f011e5b2148132348ccf4e0392e5d7cd34e310af (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
26
27
28
29
30
31
32
33
34
35
//! This test checks the behaviour of walking into binders
//! and normalizing something behind them actually works.

// edition: 2021

#![feature(type_alias_impl_trait)]

trait B {
    type C;
}

struct A;

impl<'a> B for &'a A {
    type C = Tait;
}

type Tait = impl std::fmt::Debug;

struct Terminator;

type Successors<'a> = impl std::fmt::Debug + 'a;

impl Terminator {
    fn successors(&self, mut f: for<'x> fn(&'x ()) -> <&'x A as B>::C) -> Successors<'_> {
        f = g;
        //~^ ERROR item constrains opaque type that is not in its signature
    }
}

fn g(_: &()) -> String {
    String::new()
}

fn main() {}