diff options
Diffstat (limited to 'src/test')
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() { |
