]> git.lizzy.rs Git - rust.git/commitdiff
Regression test for #19982
authorTamir Duberstein <tamird@gmail.com>
Sun, 15 Mar 2015 19:44:37 +0000 (12:44 -0700)
committerTamir Duberstein <tamird@gmail.com>
Mon, 16 Mar 2015 14:35:23 +0000 (07:35 -0700)
Closes #17165, #19982.

src/test/compile-fail/issue-19982.rs [new file with mode: 0644]
src/test/run-pass/issue-19982.rs [new file with mode: 0644]

diff --git a/src/test/compile-fail/issue-19982.rs b/src/test/compile-fail/issue-19982.rs
new file mode 100644 (file)
index 0000000..9dbca99
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2015 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)]
+
+struct Foo;
+
+impl Fn<(&(),)> for Foo { } //~ ERROR missing lifetime specifier
+
+fn main() {}
diff --git a/src/test/run-pass/issue-19982.rs b/src/test/run-pass/issue-19982.rs
new file mode 100644 (file)
index 0000000..3082fc2
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2015 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(core,unboxed_closures)]
+
+#[allow(dead_code)]
+struct Foo;
+
+impl<'a> Fn<(&'a (),)> for Foo {
+    type Output = ();
+
+    extern "rust-call" fn call(&self, (_,): (&(),)) {}
+}
+
+fn main() {}