diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-868.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-868.rs b/src/test/ui/issues/issue-868.rs new file mode 100644 index 000000000..ce0a3c7ca --- /dev/null +++ b/src/test/ui/issues/issue-868.rs @@ -0,0 +1,18 @@ +// run-pass +#![allow(unused_parens)] +// pretty-expanded FIXME #23616 + +fn f<T, F>(g: F) -> T where F: FnOnce() -> T { g() } + +pub 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 _ = (||{}); +} |