]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closure-expected-type/expect-infer-var-supply-ty-with-bound-region.rs
forward read_c_str method from Memory to Alloc
[rust.git] / src / test / ui / closure-expected-type / expect-infer-var-supply-ty-with-bound-region.rs
1 // compile-pass
2
3 fn with_closure<F, A>(_: F)
4     where F: FnOnce(A, &u32)
5 {
6 }
7
8 fn foo() {
9     // This version works; we infer `A` to be `u32`, and take the type
10     // of `y` to be `&u32`.
11     with_closure(|x: u32, y| {});
12 }
13
14 fn bar() {
15     // This version also works.
16     with_closure(|x: &u32, y| {});
17 }
18
19 fn main() { }