From faf68f473ff70743c316e91632c4616ea62f820f Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sun, 7 Oct 2018 23:48:51 -0700 Subject: [PATCH] Hooray! 19982 finally works the way people wanted in December 2014 :) --- src/test/ui/issues/issue-19982-2.rs | 33 --------------------------- src/test/ui/issues/issue-19982.rs | 19 +++++++++++++-- src/test/ui/issues/issue-19982.stderr | 9 -------- 3 files changed, 17 insertions(+), 44 deletions(-) delete mode 100644 src/test/ui/issues/issue-19982-2.rs delete mode 100644 src/test/ui/issues/issue-19982.stderr diff --git a/src/test/ui/issues/issue-19982-2.rs b/src/test/ui/issues/issue-19982-2.rs deleted file mode 100644 index 8c3462dcf45..00000000000 --- a/src/test/ui/issues/issue-19982-2.rs +++ /dev/null @@ -1,33 +0,0 @@ -// 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-pass -// pretty-expanded FIXME #23616 - -#![feature(fn_traits, unboxed_closures)] - -#[allow(dead_code)] -struct Foo; - -impl<'a> Fn<(&'a (),)> for Foo { - extern "rust-call" fn call(&self, (_,): (&(),)) {} -} - -impl<'a> FnMut<(&'a (),)> for Foo { - extern "rust-call" fn call_mut(&mut self, (_,): (&(),)) {} -} - -impl<'a> FnOnce<(&'a (),)> for Foo { - type Output = (); - - extern "rust-call" fn call_once(self, (_,): (&(),)) {} -} - -fn main() {} diff --git a/src/test/ui/issues/issue-19982.rs b/src/test/ui/issues/issue-19982.rs index 9dbca997341..3de817c28a8 100644 --- a/src/test/ui/issues/issue-19982.rs +++ b/src/test/ui/issues/issue-19982.rs @@ -8,10 +8,25 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] +// compile-pass +#![feature(fn_traits, unboxed_closures)] + +#[allow(dead_code)] struct Foo; -impl Fn<(&(),)> for Foo { } //~ ERROR missing lifetime specifier +impl Fn<(&(),)> for Foo { + extern "rust-call" fn call(&self, (_,): (&(),)) {} +} + +impl FnMut<(&(),)> for Foo { + extern "rust-call" fn call_mut(&mut self, (_,): (&(),)) {} +} + +impl FnOnce<(&(),)> for Foo { + type Output = (); + + extern "rust-call" fn call_once(self, (_,): (&(),)) {} +} fn main() {} diff --git a/src/test/ui/issues/issue-19982.stderr b/src/test/ui/issues/issue-19982.stderr deleted file mode 100644 index 9f13ba640a9..00000000000 --- a/src/test/ui/issues/issue-19982.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0106]: missing lifetime specifier - --> $DIR/issue-19982.rs:15:10 - | -LL | impl Fn<(&(),)> for Foo { } //~ ERROR missing lifetime specifier - | ^ expected lifetime parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0106`.