rust/tests/ui/issues/issue-23046.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
539 B
Rust
Raw Normal View History

pub enum Expr<'var, VAR> {
Let(Box<Expr<'var, VAR>>,
2019-05-28 18:46:13 +00:00
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() {
2020-10-19 16:58:44 +00:00
let ex = |x| { //~ ERROR type annotations needed
let_(add(x,x), |y| {
let_(add(x, x), |x|x)})};
}