summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-23046.rs
blob: a68369616d8b62a32b84bfc9a0e5b2994eae5bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pub enum Expr<'var, VAR> {
    Let(Box<Expr<'var, VAR>>,
        Box<dyn for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR> + 'var>)
}

pub fn add<'var, VAR>
                      (a: Expr<'var, VAR>, b: Expr<'var, VAR>) -> Expr<'var, VAR> {
    loop {}
}

pub fn let_<'var, VAR, F: for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR>>
                       (a: Expr<'var, VAR>, b: F) -> Expr<'var, VAR> {
    loop {}
}

fn main() {
    let ex = |x| { //~ ERROR type annotations needed
        let_(add(x,x), |y| {
            let_(add(x, x), |x|x)})};
}