summaryrefslogtreecommitdiffstats
path: root/tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs
blob: a4a8a5ac6ccbc42c127e2e631ca1747b4e051d39 (plain)
1
2
3
4
5
6
7
8
9
10
11
// run-pass
// Test HRTB used with the `Fn` trait.

fn foo<F:Fn(&isize)>(f: F) {
    let x = 22;
    f(&x);
}

fn main() {
    foo(|x: &isize| println!("{}", *x));
}