]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-868.rs
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[rust.git] / src / test / ui / issues / issue-868.rs
1 // run-pass
2 #![allow(unused_parens)]
3 // pretty-expanded FIXME #23616
4
5 fn f<T, F>(g: F) -> T where F: FnOnce() -> T { g() }
6
7 pub fn main() {
8   let _x = f( | | { 10 });
9     // used to be: cannot determine a type for this expression
10     f(| | { });
11     // ditto
12     f( | | { ()});
13     // always worked
14     let _: () = f(| | { });
15     // empty block with no type info should compile too
16     let _ = f(||{});
17     let _ = (||{});
18 }