summaryrefslogtreecommitdiffstats
path: root/src/test/ui/newlambdas.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/newlambdas.rs')
-rw-r--r--src/test/ui/newlambdas.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/newlambdas.rs b/src/test/ui/newlambdas.rs
new file mode 100644
index 000000000..90de53856
--- /dev/null
+++ b/src/test/ui/newlambdas.rs
@@ -0,0 +1,14 @@
+// run-pass
+// Tests for the new |args| expr lambda syntax
+
+
+fn f<F>(i: isize, f: F) -> isize where F: FnOnce(isize) -> isize { f(i) }
+
+fn g<G>(_g: G) where G: FnOnce() { }
+
+pub fn main() {
+ assert_eq!(f(10, |a| a), 10);
+ g(||());
+ assert_eq!(f(10, |a| a), 10);
+ g(||{});
+}