about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-05-27 23:02:44 +0000
committerbors <bors@rust-lang.org>2017-05-27 23:02:44 +0000
commit5d2512ec5b03a1155054df881e40e35fc87d6351 (patch)
tree7aed5ec881348ccaf35d17655003aee7e33ebf5c /src/test
parent28fd1e519a3807c632d58d01e73b4948000639ba (diff)
parent87950b79de4bd12ad02f32dbebc60ab1bef17f82 (diff)
Auto merge of #42162 - est31:closure-to-fn-coercion, r=aturon
Stabilize non capturing closure to fn coercion

Stabilisation PR for non capturing closure to fn coercion.

closes #39817
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/feature-gate-closure_to_fn_coercion.rs45
-rw-r--r--src/test/compile-fail/issue-40000.rs2
-rw-r--r--src/test/run-pass/closure-to-fn-coercion.rs4
-rw-r--r--src/test/run-pass/closure_to_fn_coercion-expected-types.rs1
4 files changed, 0 insertions, 52 deletions
diff --git a/src/test/compile-fail/feature-gate-closure_to_fn_coercion.rs b/src/test/compile-fail/feature-gate-closure_to_fn_coercion.rs
deleted file mode 100644
index d074a35628e..00000000000
--- a/src/test/compile-fail/feature-gate-closure_to_fn_coercion.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2017 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.
-
-// ignore-stage0: new feature, remove this when SNAP
-// revisions: a b
-
-#[cfg(a)]
-mod a {
-    const FOO: fn(u8) -> u8 = |v: u8| { v };
-    //[a]~^ ERROR non-capturing closure to fn coercion is experimental
-    //[a]~^^ ERROR mismatched types
-
-    const BAR: [fn(&mut u32); 1] = [
-        |v: &mut u32| *v += 1,
-    //[a]~^ ERROR non-capturing closure to fn coercion is experimental
-    //[a]~^^ ERROR mismatched types
-    ];
-}
-
-#[cfg(b)]
-mod b {
-    fn func_specific() -> (fn() -> u32) {
-        || return 42
-        //[b]~^ ERROR non-capturing closure to fn coercion is experimental
-        //[b]~^^ ERROR mismatched types
-    }
-    fn foo() {
-        // Items
-        assert_eq!(func_specific()(), 42);
-        let foo: fn(u8) -> u8 = |v: u8| { v };
-        //[b]~^ ERROR non-capturing closure to fn coercion is experimental
-        //[b]~^^ ERROR mismatched types
-    }
-
-}
-
-
-
diff --git a/src/test/compile-fail/issue-40000.rs b/src/test/compile-fail/issue-40000.rs
index 3ccee0f12be..7daf4bcbaa4 100644
--- a/src/test/compile-fail/issue-40000.rs
+++ b/src/test/compile-fail/issue-40000.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(closure_to_fn_coercion)]
-
 fn main() {
     let bar: fn(&mut u32) = |_| {};
 
diff --git a/src/test/run-pass/closure-to-fn-coercion.rs b/src/test/run-pass/closure-to-fn-coercion.rs
index 13d1d6aa139..7fb26bdc936 100644
--- a/src/test/run-pass/closure-to-fn-coercion.rs
+++ b/src/test/run-pass/closure-to-fn-coercion.rs
@@ -8,10 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-stage0: new feature, remove this when SNAP
-
-#![feature(closure_to_fn_coercion)]
-
 const FOO: fn(u8) -> u8 = |v: u8| { v };
 
 const BAR: [fn(&mut u32); 5] = [
diff --git a/src/test/run-pass/closure_to_fn_coercion-expected-types.rs b/src/test/run-pass/closure_to_fn_coercion-expected-types.rs
index 7214ebfaf07..41da3089c88 100644
--- a/src/test/run-pass/closure_to_fn_coercion-expected-types.rs
+++ b/src/test/run-pass/closure_to_fn_coercion-expected-types.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 // Ensure that we deduce expected argument types when a `fn()` type is expected (#41755)
 
-#![feature(closure_to_fn_coercion)]
 fn foo(f: fn(Vec<u32>) -> usize) { }
 
 fn main() {