about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-08-06 16:01:12 -0400
committerCorey Farwell <coreyf@rwell.org>2016-08-06 16:01:12 -0400
commit7fd7af91992035a25cf7acc004df06c026fac631 (patch)
treef2f5a556226bcb842d0f72823ff4b0dd576167cc
parent444ff9fbfb1f2a8e6645f67684f8a9ad99b343d3 (diff)
downloadrust-7fd7af91992035a25cf7acc004df06c026fac631.tar.gz
rust-7fd7af91992035a25cf7acc004df06c026fac631.zip
Add regression test for #20847.
-rw-r--r--src/test/run-pass/issue-20847.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-20847.rs b/src/test/run-pass/issue-20847.rs
new file mode 100644
index 00000000000..d2c33560545
--- /dev/null
+++ b/src/test/run-pass/issue-20847.rs
@@ -0,0 +1,21 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(fn_traits)]
+
+use std::ops::Fn;
+
+fn say(x: u32, y: u32) {
+    println!("{} {}", x, y);
+}
+
+fn main() {
+    Fn::call(&say, (1, 2));
+}