Skip to content

Commit d19b915

Browse files
committed
Add test for issue 868
1 parent 96c6f57 commit d19b915

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/run-pass/issue-868.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
fn f<T>(g: fn() -> T) -> T { g() }
2+
3+
fn main() {
4+
let _x = f( | | { 10 });
5+
// used to be: cannot determine a type for this expression
6+
f(| | { });
7+
// ditto
8+
f( | | { ()});
9+
// always worked
10+
let _: () = f(| | { });
11+
// empty block with no type info should compile too
12+
let _ = f(||{});
13+
let _ = (||{});
14+
}
15+

0 commit comments

Comments
 (0)