diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-07-26 14:29:24 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-07-26 14:29:47 -0700 |
| commit | d19b915bc40d36cdf9866bfd3cf160ddabc7cc9d (patch) | |
| tree | 10e12643b983f89b395e73352af7dc303c075e2b /src | |
| parent | 96c6f57d18a26157117911a05152e135cfcee2ff (diff) | |
Add test for issue 868
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/run-pass/issue-868.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-868.rs b/src/test/run-pass/issue-868.rs new file mode 100644 index 00000000000..dcc8c4e08db --- /dev/null +++ b/src/test/run-pass/issue-868.rs @@ -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 _ = (||{}); +} + |
