]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closure-expected-type/expect-fn-supply-fn-multiple.rs
Rollup merge of #105758 - Nilstrieb:typeck-results-mod, r=compiler-errors
[rust.git] / src / test / ui / closure-expected-type / expect-fn-supply-fn-multiple.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2
3 #![allow(warnings)]
4
5 type Different<'a, 'b> = &'a mut (&'a (), &'b ());
6 type Same<'a> = Different<'a, 'a>;
7
8 fn with_closure_expecting_different<F>(_: F)
9     where F: for<'a, 'b> FnOnce(Different<'a, 'b>)
10 {
11 }
12
13 fn with_closure_expecting_different_anon<F>(_: F)
14     where F: FnOnce(Different<'_, '_>)
15 {
16 }
17
18 fn supplying_nothing_expecting_anon() {
19     with_closure_expecting_different_anon(|x: Different| {
20     })
21 }
22
23 fn supplying_nothing_expecting_named() {
24     with_closure_expecting_different(|x: Different| {
25     })
26 }
27
28 fn supplying_underscore_expecting_anon() {
29     with_closure_expecting_different_anon(|x: Different<'_, '_>| {
30     })
31 }
32
33 fn supplying_underscore_expecting_named() {
34     with_closure_expecting_different(|x: Different<'_, '_>| {
35     })
36 }
37
38 fn main() { }