Add test for issue 868
This commit is contained in:
parent
96c6f57d18
commit
d19b915bc4
1 changed files with 15 additions and 0 deletions
15
src/test/run-pass/issue-868.rs
Normal file
15
src/test/run-pass/issue-868.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
fn f<T>(g: fn() -> T) -> T { g() }
|
||||
|
||||
fn main() {
|
||||
let _x = f( | | { 10 });
|
||||
// used to be: cannot determine a type for this expression
|
||||
f(| | { });
|
||||
// ditto
|
||||
f( | | { ()});
|
||||
// always worked
|
||||
let _: () = f(| | { });
|
||||
// empty block with no type info should compile too
|
||||
let _ = f(||{});
|
||||
let _ = (||{});
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue