about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@squareup.com>2014-12-22 21:09:40 -0800
committerTamir Duberstein <tamird@squareup.com>2014-12-28 09:22:53 -0800
commit0579d5846b00eb577d8a89aa563e43e81cc4426b (patch)
treec9b7a763428837acf4c726da2615b33d23796431 /src/test
parentee6b97d5af6b6cf78732b994cda5c244c8b99436 (diff)
Regression test for #13655
Closes #13655.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-13655.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-13655.rs b/src/test/run-pass/issue-13655.rs
new file mode 100644
index 00000000000..6fdaac99204
--- /dev/null
+++ b/src/test/run-pass/issue-13655.rs
@@ -0,0 +1,27 @@
+// Copyright 2014 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(unboxed_closures)]
+use std::ops::Fn;
+
+struct Foo<T>(T);
+
+impl<T: Copy> Fn<(), T> for Foo<T> {
+    extern "rust-call" fn call(&self, _: ()) -> T {
+      match *self {
+        Foo(t) => t
+      }
+    }
+}
+
+fn main() {
+  let t: u8 = 1;
+  println!("{}", Foo(t)());
+}