]> git.lizzy.rs Git - rust.git/blob - tests/ui/higher-rank-trait-bounds/hrtb-unboxed-closure-trait.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / higher-rank-trait-bounds / hrtb-unboxed-closure-trait.rs
1 // run-pass
2 // Test HRTB used with the `Fn` trait.
3
4 fn foo<F:Fn(&isize)>(f: F) {
5     let x = 22;
6     f(&x);
7 }
8
9 fn main() {
10     foo(|x: &isize| println!("{}", *x));
11 }