]> git.lizzy.rs Git - rust.git/blob - tests/ui/closure-expected-type/expect-infer-var-supply-ty-with-free-region.rs
Rollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco
[rust.git] / tests / ui / closure-expected-type / expect-infer-var-supply-ty-with-free-region.rs
1 // build-pass (FIXME(62277): could be check-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<'x>(x: &'x u32) {
15     // Same.
16     with_closure(|x: &'x u32, y| {});
17 }
18
19 fn main() { }