mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
Add test for issue 868
This commit is contained in:
parent
96c6f57d18
commit
d19b915bc4
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…
Reference in New Issue
Block a user