diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 7fc6e54d69f..21387a1aa95 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -49,7 +49,6 @@ #![feature(specialization)] #![feature(staged_api)] #![feature(step_by)] -#![feature(unboxed_closures)] #![feature(unicode)] #![feature(unique)] #![feature(unsafe_no_drop_flag)] diff --git a/src/libcoretest/lib.rs b/src/libcoretest/lib.rs index ef0042808f9..9428b4096bf 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -31,7 +31,6 @@ #![feature(step_by)] #![feature(test)] #![feature(try_from)] -#![feature(unboxed_closures)] #![feature(unicode)] #![feature(unique)] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 766e3883f26..f49d47fb081 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -31,7 +31,6 @@ #![feature(set_stdio)] #![feature(staged_api)] #![feature(question_mark)] -#![feature(unboxed_closures)] extern crate arena; extern crate flate; diff --git a/src/librustc_typeck/check/callee.rs b/src/librustc_typeck/check/callee.rs index 9c6727ebbfc..bd2c05ba66d 100644 --- a/src/librustc_typeck/check/callee.rs +++ b/src/librustc_typeck/check/callee.rs @@ -27,33 +27,8 @@ use rustc::hir; /// to `trait_id` (this only cares about the trait, not the specific /// method that is called) pub fn check_legal_trait_for_method_call(ccx: &CrateCtxt, span: Span, trait_id: DefId) { - let tcx = ccx.tcx; - let did = Some(trait_id); - let li = &tcx.lang_items; - - if did == li.drop_trait() { - span_err!(tcx.sess, span, E0040, "explicit use of destructor method"); - } else if !tcx.sess.features.borrow().unboxed_closures { - // the #[feature(unboxed_closures)] feature isn't - // activated so we need to enforce the closure - // restrictions. - - let method = if did == li.fn_trait() { - "call" - } else if did == li.fn_mut_trait() { - "call_mut" - } else if did == li.fn_once_trait() { - "call_once" - } else { - return // not a closure method, everything is OK. - }; - - struct_span_err!(tcx.sess, span, E0174, - "explicit use of unboxed closure method `{}` is experimental", - method) - .help("add `#![feature(unboxed_closures)]` to the crate \ - attributes to enable") - .emit(); + if ccx.tcx.lang_items.drop_trait() == Some(trait_id) { + span_err!(ccx.tcx.sess, span, E0040, "explicit use of destructor method"); } } diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 500f624ea3f..cd2259a2834 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -1944,89 +1944,6 @@ To learn more about traits, take a look at the Book: https://doc.rust-lang.org/book/traits.html "##, -E0174: r##" -This error occurs because of the explicit use of unboxed closure methods -that are an experimental feature in current Rust version. - -Example of erroneous code: - -```compile_fail -fn foo(mut f: F) { - f.call(("call",)); - // error: explicit use of unboxed closure method `call` - f.call_mut(("call_mut",)); - // error: explicit use of unboxed closure method `call_mut` - f.call_once(("call_once",)); - // error: explicit use of unboxed closure method `call_once` -} - -fn bar(text: &str) { - println!("Calling {} it works!", text); -} - -fn main() { - foo(bar); -} -``` - -Rust's implementation of closures is a bit different than other languages. -They are effectively syntax sugar for traits `Fn`, `FnMut` and `FnOnce`. -To understand better how the closures are implemented see here: -https://doc.rust-lang.org/book/closures.html#closure-implementation - -To fix this you can call them using parenthesis, like this: `foo()`. -When you execute the closure with parenthesis, under the hood you are executing -the method `call`, `call_mut` or `call_once`. However, using them explicitly is -currently an experimental feature. - -Example of an implicit call: - -``` -fn foo(f: F) { - f("using ()"); // Calling using () it works! -} - -fn bar(text: &str) { - println!("Calling {} it works!", text); -} - -fn main() { - foo(bar); -} -``` - -To enable the explicit calls you need to add `#![feature(unboxed_closures)]`. - -This feature is still unstable so you will also need to add -`#![feature(fn_traits)]`. -More details about this issue here: -https://github.com/rust-lang/rust/issues/29625 - -Example of use: - -``` -#![feature(fn_traits)] -#![feature(unboxed_closures)] - -fn foo(mut f: F) { - f.call(("call",)); // Calling 'call' it works! - f.call_mut(("call_mut",)); // Calling 'call_mut' it works! - f.call_once(("call_once",)); // Calling 'call_once' it works! -} - -fn bar(text: &str) { - println!("Calling '{}' it works!", text); -} - -fn main() { - foo(bar); -} -``` - -To see more about closures take a look here: -https://doc.rust-lang.org/book/closures.html` -"##, - E0178: r##" In types, the `+` type operator has low precedence, so it is often necessary to use parentheses. @@ -4049,6 +3966,7 @@ register_diagnostics! { E0167, // E0168, // E0173, // manual implementations of unboxed closure traits are experimental +// E0174, E0182, E0183, // E0187, // can't infer the kind of the closure diff --git a/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs b/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs index f60f06b4ec8..de6ce798d63 100644 --- a/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs +++ b/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs @@ -12,7 +12,6 @@ #![allow(dead_code)] #![feature(rustc_attrs)] -#![feature(unboxed_closures)] #![deny(hr_lifetime_in_assoc_type)] trait Foo<'a> { diff --git a/src/test/compile-fail/associated-types/cache/wasm-issue-32330.rs b/src/test/compile-fail/associated-types/cache/wasm-issue-32330.rs index 01db4770a38..6ba09acc0e7 100644 --- a/src/test/compile-fail/associated-types/cache/wasm-issue-32330.rs +++ b/src/test/compile-fail/associated-types/cache/wasm-issue-32330.rs @@ -13,7 +13,6 @@ #![allow(dead_code, unused_variables)] #![deny(hr_lifetime_in_assoc_type)] -#![feature(unboxed_closures)] use std::str::Chars; diff --git a/src/test/compile-fail/borrowck/borrowck-call-is-borrow-issue-12224.rs b/src/test/compile-fail/borrowck/borrowck-call-is-borrow-issue-12224.rs index 7626f354eb4..e4ae565fe92 100644 --- a/src/test/compile-fail/borrowck/borrowck-call-is-borrow-issue-12224.rs +++ b/src/test/compile-fail/borrowck/borrowck-call-is-borrow-issue-12224.rs @@ -10,8 +10,6 @@ // Ensure that invoking a closure counts as a unique immutable borrow -#![feature(unboxed_closures)] - type Fn<'a> = Box; struct Test<'a> { diff --git a/src/test/compile-fail/borrowck/borrowck-unboxed-closures.rs b/src/test/compile-fail/borrowck/borrowck-unboxed-closures.rs index 1c12ca9c1de..0f9829ab259 100644 --- a/src/test/compile-fail/borrowck/borrowck-unboxed-closures.rs +++ b/src/test/compile-fail/borrowck/borrowck-unboxed-closures.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(overloaded_calls, unboxed_closures)] - fn a isize>(mut f: F) { let g = &mut f; f(1, 2); //~ ERROR cannot borrow `f` as immutable diff --git a/src/test/compile-fail/feature-gate-unboxed-closures-method-calls.rs b/src/test/compile-fail/feature-gate-unboxed-closures-method-calls.rs index eea1f61d639..253d1633b1c 100644 --- a/src/test/compile-fail/feature-gate-unboxed-closures-method-calls.rs +++ b/src/test/compile-fail/feature-gate-unboxed-closures-method-calls.rs @@ -11,9 +11,9 @@ #![allow(dead_code)] fn foo(mut f: F) { - f.call(()); //~ ERROR explicit use of unboxed closure method `call` - f.call_mut(()); //~ ERROR explicit use of unboxed closure method `call_mut` - f.call_once(()); //~ ERROR explicit use of unboxed closure method `call_once` + f.call(()); //~ ERROR use of unstable library feature 'fn_traits' + f.call_mut(()); //~ ERROR use of unstable library feature 'fn_traits' + f.call_once(()); //~ ERROR use of unstable library feature 'fn_traits' } fn main() {} diff --git a/src/test/compile-fail/feature-gate-unboxed-closures-ufcs-calls.rs b/src/test/compile-fail/feature-gate-unboxed-closures-ufcs-calls.rs index f15c5c4da2c..902b3c1774c 100644 --- a/src/test/compile-fail/feature-gate-unboxed-closures-ufcs-calls.rs +++ b/src/test/compile-fail/feature-gate-unboxed-closures-ufcs-calls.rs @@ -10,10 +10,10 @@ #![allow(dead_code)] -fn foo(mut f: F, mut g: F) { - Fn::call(&g, ()); //~ ERROR explicit use of unboxed closure method `call` - FnMut::call_mut(&mut g, ()); //~ ERROR explicit use of unboxed closure method `call_mut` - FnOnce::call_once(g, ()); //~ ERROR explicit use of unboxed closure method `call_once` +fn foo(mut f: F) { + Fn::call(&f, ()); //~ ERROR use of unstable library feature 'fn_traits' + FnMut::call_mut(&mut f, ()); //~ ERROR use of unstable library feature 'fn_traits' + FnOnce::call_once(f, ()); //~ ERROR use of unstable library feature 'fn_traits' } fn main() {} diff --git a/src/test/compile-fail/fn-trait-formatting.rs b/src/test/compile-fail/fn-trait-formatting.rs index fd140cd1d39..e01a0412cef 100644 --- a/src/test/compile-fail/fn-trait-formatting.rs +++ b/src/test/compile-fail/fn-trait-formatting.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] #![feature(box_syntax)] fn needs_fn(x: F) where F: Fn(isize) -> isize {} diff --git a/src/test/compile-fail/issue-16939.rs b/src/test/compile-fail/issue-16939.rs index 7ec3fef5c87..e16c58b8a6c 100644 --- a/src/test/compile-fail/issue-16939.rs +++ b/src/test/compile-fail/issue-16939.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(overloaded_calls, unboxed_closures)] - // Make sure we don't ICE when making an overloaded call with the // wrong arity. diff --git a/src/test/compile-fail/issue-17033.rs b/src/test/compile-fail/issue-17033.rs index f0fe01b4159..0ec05b941a9 100644 --- a/src/test/compile-fail/issue-17033.rs +++ b/src/test/compile-fail/issue-17033.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(overloaded_calls)] - fn f<'r>(p: &'r mut fn(p: &mut ())) { (*p)(()) //~ ERROR mismatched types //~| expected type `&mut ()` diff --git a/src/test/compile-fail/issue-17545.rs b/src/test/compile-fail/issue-17545.rs index 84800218efc..49435f83ce3 100644 --- a/src/test/compile-fail/issue-17545.rs +++ b/src/test/compile-fail/issue-17545.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - pub fn foo<'a, F: Fn(&'a ())>(bar: F) { bar.call(( &(), //~ ERROR borrowed value does not live long enough diff --git a/src/test/compile-fail/issue-17551.rs b/src/test/compile-fail/issue-17551.rs index 5781cb74117..5e69553d3a4 100644 --- a/src/test/compile-fail/issue-17551.rs +++ b/src/test/compile-fail/issue-17551.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - use std::marker; struct B(marker::PhantomData); diff --git a/src/test/compile-fail/issue-18532.rs b/src/test/compile-fail/issue-18532.rs index 9cf922ae990..94eab97c42a 100644 --- a/src/test/compile-fail/issue-18532.rs +++ b/src/test/compile-fail/issue-18532.rs @@ -12,8 +12,6 @@ // when a type error or unconstrained type variable propagates // into it. -#![feature(unboxed_closures)] - fn main() { (return)((),()); //~^ ERROR the type of this value must be known diff --git a/src/test/compile-fail/issue-19521.rs b/src/test/compile-fail/issue-19521.rs index 58a95e9da2b..93d95ca0b0f 100644 --- a/src/test/compile-fail/issue-19521.rs +++ b/src/test/compile-fail/issue-19521.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - fn main() { "".homura()(); //~ ERROR no method named `homura` found } diff --git a/src/test/compile-fail/issue-19707.rs b/src/test/compile-fail/issue-19707.rs index 9affb44b744..beeb7da6d38 100644 --- a/src/test/compile-fail/issue-19707.rs +++ b/src/test/compile-fail/issue-19707.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] #![allow(dead_code)] type foo = fn(&u8, &u8) -> &u8; //~ ERROR missing lifetime specifier diff --git a/src/test/compile-fail/issue-4335.rs b/src/test/compile-fail/issue-4335.rs index 0089bff3e8f..9a1b5d9b83d 100644 --- a/src/test/compile-fail/issue-4335.rs +++ b/src/test/compile-fail/issue-4335.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - fn id(t: T) -> T { t } fn f<'r, T>(v: &'r T) -> Box T + 'r> { diff --git a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs index 5af326b4298..df9a3519d5d 100644 --- a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs +++ b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs @@ -12,8 +12,6 @@ // bound must be noncopyable. For details see // http://smallcultfollowing.com/babysteps/blog/2013/04/30/the-case-of-the-recurring-closure/ -#![feature(unboxed_closures)] - struct R<'a> { // This struct is needed to create the // otherwise infinite type of a fn that diff --git a/src/test/compile-fail/regionck-unboxed-closure-lifetimes.rs b/src/test/compile-fail/regionck-unboxed-closure-lifetimes.rs index 5db9a01c012..8ec6036762f 100644 --- a/src/test/compile-fail/regionck-unboxed-closure-lifetimes.rs +++ b/src/test/compile-fail/regionck-unboxed-closure-lifetimes.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures, overloaded_calls)] - use std::ops::FnMut; fn main() { diff --git a/src/test/compile-fail/regions-escape-unboxed-closure.rs b/src/test/compile-fail/regions-escape-unboxed-closure.rs index abbefd25488..cf41fad2708 100644 --- a/src/test/compile-fail/regions-escape-unboxed-closure.rs +++ b/src/test/compile-fail/regions-escape-unboxed-closure.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - fn with_int(f: &mut FnMut(&isize)) { } diff --git a/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs b/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs index 1e2224eafae..99e5cc03153 100644 --- a/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs +++ b/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs @@ -10,8 +10,6 @@ // Test that closures cannot subvert aliasing restrictions -#![feature(overloaded_calls, unboxed_closures)] - fn main() { // Unboxed closure case { diff --git a/src/test/compile-fail/regions-steal-closure.rs b/src/test/compile-fail/regions-steal-closure.rs index a30d8471a31..8ade8b239b3 100644 --- a/src/test/compile-fail/regions-steal-closure.rs +++ b/src/test/compile-fail/regions-steal-closure.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - struct closure_box<'a> { cl: Box, } diff --git a/src/test/compile-fail/unboxed-closure-immutable-capture.rs b/src/test/compile-fail/unboxed-closure-immutable-capture.rs index 5be2738b47e..2d998374229 100644 --- a/src/test/compile-fail/unboxed-closure-immutable-capture.rs +++ b/src/test/compile-fail/unboxed-closure-immutable-capture.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - // Test that even unboxed closures that are capable of mutating their // environment cannot mutate captured variables that have not been // declared mutable (#18335) diff --git a/src/test/compile-fail/unboxed-closure-region.rs b/src/test/compile-fail/unboxed-closure-region.rs index eee1b6ce30b..1c86dda3378 100644 --- a/src/test/compile-fail/unboxed-closure-region.rs +++ b/src/test/compile-fail/unboxed-closure-region.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - // Test that an unboxed closure that captures a free variable by // reference cannot escape the region of that variable. fn main() { diff --git a/src/test/compile-fail/unboxed-closure-sugar-nonexistent-trait.rs b/src/test/compile-fail/unboxed-closure-sugar-nonexistent-trait.rs index 21450856ae6..465bddd060d 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-nonexistent-trait.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-nonexistent-trait.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - fn f isize>(x: F) {} //~ ERROR trait `Nonexist` is not in scope type Typedef = isize; diff --git a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs b/src/test/compile-fail/unboxed-closures-borrow-conflict.rs index 372f3277931..ad7e6784a0a 100644 --- a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs +++ b/src/test/compile-fail/unboxed-closures-borrow-conflict.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - // Test that an unboxed closure that mutates a free variable will // cause borrow conflicts. diff --git a/src/test/compile-fail/unboxed-closures-infer-argument-types-two-region-pointers.rs b/src/test/compile-fail/unboxed-closures-infer-argument-types-two-region-pointers.rs index 1e2b01856e7..5436a855ee7 100644 --- a/src/test/compile-fail/unboxed-closures-infer-argument-types-two-region-pointers.rs +++ b/src/test/compile-fail/unboxed-closures-infer-argument-types-two-region-pointers.rs @@ -11,8 +11,6 @@ // That a closure whose expected argument types include two distinct // bound regions. -#![feature(unboxed_closures)] - use std::cell::Cell; fn doit(val: T, f: &F) diff --git a/src/test/compile-fail/unboxed-closures-infer-explicit-call-too-early.rs b/src/test/compile-fail/unboxed-closures-infer-explicit-call-too-early.rs index 226b516e09d..62f6ee56ca5 100644 --- a/src/test/compile-fail/unboxed-closures-infer-explicit-call-too-early.rs +++ b/src/test/compile-fail/unboxed-closures-infer-explicit-call-too-early.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - fn main() { let mut zero = || {}; let () = zero.call_mut(()); diff --git a/src/test/compile-fail/unboxed-closures-type-mismatch.rs b/src/test/compile-fail/unboxed-closures-type-mismatch.rs index 91182393ac8..dba4c8cc2e9 100644 --- a/src/test/compile-fail/unboxed-closures-type-mismatch.rs +++ b/src/test/compile-fail/unboxed-closures-type-mismatch.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - use std::ops::FnMut; pub fn main() { diff --git a/src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs b/src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs index cba7ad82ee1..2b0a8baf4f2 100644 --- a/src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs +++ b/src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs @@ -10,8 +10,6 @@ // Tests that unsafe extern fn pointers do not implement any Fn traits. -#![feature(unboxed_closures)] - use std::ops::{Fn,FnMut,FnOnce}; unsafe fn square(x: &isize) -> isize { (*x) * (*x) } diff --git a/src/test/compile-fail/unboxed-closures-wrong-abi.rs b/src/test/compile-fail/unboxed-closures-wrong-abi.rs index dd891bc473c..f6ba25f4368 100644 --- a/src/test/compile-fail/unboxed-closures-wrong-abi.rs +++ b/src/test/compile-fail/unboxed-closures-wrong-abi.rs @@ -10,8 +10,6 @@ // Tests that unsafe extern fn pointers do not implement any Fn traits. -#![feature(unboxed_closures)] - use std::ops::{Fn,FnMut,FnOnce}; extern "C" fn square(x: &isize) -> isize { (*x) * (*x) } diff --git a/src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs b/src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs index f9edd5df673..9d907ffc17f 100644 --- a/src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs +++ b/src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs @@ -10,8 +10,6 @@ // Tests that unsafe extern fn pointers do not implement any Fn traits. -#![feature(unboxed_closures)] - use std::ops::{Fn,FnMut,FnOnce}; unsafe fn square(x: isize) -> isize { x * x } diff --git a/src/test/debuginfo/var-captured-in-sendable-closure.rs b/src/test/debuginfo/var-captured-in-sendable-closure.rs index aa269edadd8..b415546faea 100644 --- a/src/test/debuginfo/var-captured-in-sendable-closure.rs +++ b/src/test/debuginfo/var-captured-in-sendable-closure.rs @@ -40,7 +40,7 @@ // lldb-check:[...]$2 = 5 #![allow(unused_variables)] -#![feature(unboxed_closures, box_syntax)] +#![feature(box_syntax)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs index 6def5cf2859..e60f964dd09 100644 --- a/src/test/debuginfo/var-captured-in-stack-closure.rs +++ b/src/test/debuginfo/var-captured-in-stack-closure.rs @@ -69,7 +69,7 @@ // lldb-command:print *owned // lldb-check:[...]$9 = 6 -#![feature(unboxed_closures, box_syntax)] +#![feature(box_syntax)] #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] diff --git a/src/test/run-pass/assignability-trait.rs b/src/test/run-pass/assignability-trait.rs index 0ee460052c7..c364240f4ad 100644 --- a/src/test/run-pass/assignability-trait.rs +++ b/src/test/run-pass/assignability-trait.rs @@ -12,9 +12,6 @@ // making method calls, but only if there aren't any matches without // it. - -#![feature(unboxed_closures)] - trait iterable { fn iterate(&self, blk: F) -> bool where F: FnMut(&A) -> bool; } diff --git a/src/test/run-pass/associated-types-impl-redirect.rs b/src/test/run-pass/associated-types-impl-redirect.rs index 4082580a123..3e34367a215 100644 --- a/src/test/run-pass/associated-types-impl-redirect.rs +++ b/src/test/run-pass/associated-types-impl-redirect.rs @@ -14,7 +14,7 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -#![feature(lang_items, unboxed_closures)] +#![feature(lang_items)] #![no_implicit_prelude] use std::marker::Sized; diff --git a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs index 082ad53d559..ef1225d39a7 100644 --- a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs +++ b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs @@ -14,7 +14,7 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -#![feature(lang_items, unboxed_closures)] +#![feature(lang_items)] #![no_implicit_prelude] use std::marker::Sized; diff --git a/src/test/run-pass/auxiliary/issue-18711.rs b/src/test/run-pass/auxiliary/issue-18711.rs index a29dcc00cdd..c247c0223fc 100644 --- a/src/test/run-pass/auxiliary/issue-18711.rs +++ b/src/test/run-pass/auxiliary/issue-18711.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] #![crate_type = "rlib"] pub fn inner(f: F) -> F { diff --git a/src/test/run-pass/auxiliary/unboxed-closures-cross-crate.rs b/src/test/run-pass/auxiliary/unboxed-closures-cross-crate.rs index dac20dd2f7a..dc9798a2101 100644 --- a/src/test/run-pass/auxiliary/unboxed-closures-cross-crate.rs +++ b/src/test/run-pass/auxiliary/unboxed-closures-cross-crate.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - use std::ops::Add; #[inline] diff --git a/src/test/run-pass/bare-fn-implements-fn-mut.rs b/src/test/run-pass/bare-fn-implements-fn-mut.rs index e8118e90a9f..30a11ca2536 100644 --- a/src/test/run-pass/bare-fn-implements-fn-mut.rs +++ b/src/test/run-pass/bare-fn-implements-fn-mut.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - use std::ops::FnMut; fn call_f(mut f: F) { diff --git a/src/test/run-pass/borrowck/borrowck-move-by-capture-ok.rs b/src/test/run-pass/borrowck/borrowck-move-by-capture-ok.rs index bbc668f5cab..158594df8ca 100644 --- a/src/test/run-pass/borrowck/borrowck-move-by-capture-ok.rs +++ b/src/test/run-pass/borrowck/borrowck-move-by-capture-ok.rs @@ -11,7 +11,6 @@ #![allow(unknown_features)] #![feature(box_syntax)] -#![feature(unboxed_closures)] pub fn main() { let bar: Box<_> = box 3; diff --git a/src/test/run-pass/capture-clauses-unboxed-closures.rs b/src/test/run-pass/capture-clauses-unboxed-closures.rs index 5e7d5aacb8d..e8a9dc7b8f3 100644 --- a/src/test/run-pass/capture-clauses-unboxed-closures.rs +++ b/src/test/run-pass/capture-clauses-unboxed-closures.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unboxed_closures)] - fn each<'a,T,F:FnMut(&'a T)>(x: &'a [T], mut f: F) { for val in x { f(val) diff --git a/src/test/run-pass/closure-bounds-can-capture-chan.rs b/src/test/run-pass/closure-bounds-can-capture-chan.rs index dbbac8a1633..5268e855d5f 100644 --- a/src/test/run-pass/closure-bounds-can-capture-chan.rs +++ b/src/test/run-pass/closure-bounds-can-capture-chan.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - use std::sync::mpsc::channel; fn foo(blk: F) { diff --git a/src/test/run-pass/closure-reform.rs b/src/test/run-pass/closure-reform.rs index 0fa67e873f8..a37733bdc2d 100644 --- a/src/test/run-pass/closure-reform.rs +++ b/src/test/run-pass/closure-reform.rs @@ -11,8 +11,6 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -#![feature(unboxed_closures)] - fn call_it(f: F) where F : FnOnce(String) -> String { diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 4dae1131c6d..3f6f1aa6b5f 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -9,7 +9,7 @@ // except according to those terms. #![allow(unknown_features)] -#![feature(unboxed_closures, std_misc)] +#![feature(std_misc)] /** A somewhat reduced test case to expose some Valgrind issues. diff --git a/src/test/run-pass/hrtb-parse.rs b/src/test/run-pass/hrtb-parse.rs index ecd0bc681c3..cdffaef66eb 100644 --- a/src/test/run-pass/hrtb-parse.rs +++ b/src/test/run-pass/hrtb-parse.rs @@ -13,7 +13,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] #![allow(unused_variables)] #![allow(dead_code)] diff --git a/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs b/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs index bc00a0758f4..46ea2562961 100644 --- a/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs +++ b/src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - // Test that `F : Fn(isize) -> isize + Send` is interpreted as two // distinct bounds on `F`. diff --git a/src/test/run-pass/hrtb-precedence-of-plus.rs b/src/test/run-pass/hrtb-precedence-of-plus.rs index 892f2f1ae9d..d93e52a8f5f 100644 --- a/src/test/run-pass/hrtb-precedence-of-plus.rs +++ b/src/test/run-pass/hrtb-precedence-of-plus.rs @@ -11,7 +11,6 @@ // pretty-expanded FIXME #23616 #![allow(unknown_features)] -#![feature(unboxed_closures)] // Test that `Fn(isize) -> isize + 'static` parses as `(Fn(isize) -> isize) + // 'static` and not `Fn(isize) -> (isize + 'static)`. The latter would diff --git a/src/test/run-pass/hrtb-trait-object-paren-notation.rs b/src/test/run-pass/hrtb-trait-object-paren-notation.rs index fefbd004766..5b9d4a834d8 100644 --- a/src/test/run-pass/hrtb-trait-object-paren-notation.rs +++ b/src/test/run-pass/hrtb-trait-object-paren-notation.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unboxed_closures)] - // A basic test of using a higher-ranked trait bound. trait FnLike { diff --git a/src/test/run-pass/hrtb-unboxed-closure-trait.rs b/src/test/run-pass/hrtb-unboxed-closure-trait.rs index 008e7ddbc9c..6666b61a4a7 100644 --- a/src/test/run-pass/hrtb-unboxed-closure-trait.rs +++ b/src/test/run-pass/hrtb-unboxed-closure-trait.rs @@ -10,8 +10,6 @@ // Test HRTB used with the `Fn` trait. -#![feature(unboxed_closures)] - fn foo(f: F) { let x = 22; f(&x); diff --git a/src/test/run-pass/issue-10718.rs b/src/test/run-pass/issue-10718.rs index 0a6e454e181..fedd94e22e7 100644 --- a/src/test/run-pass/issue-10718.rs +++ b/src/test/run-pass/issue-10718.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - fn f(p: F) { p(); } diff --git a/src/test/run-pass/issue-16560.rs b/src/test/run-pass/issue-16560.rs index 596f0d20155..e91569f8b24 100644 --- a/src/test/run-pass/issue-16560.rs +++ b/src/test/run-pass/issue-16560.rs @@ -10,8 +10,6 @@ // ignore-emscripten no threads support -#![feature(unboxed_closures)] - use std::thread; use std::mem; diff --git a/src/test/run-pass/issue-16668.rs b/src/test/run-pass/issue-16668.rs index 786c701a042..0fd99650284 100644 --- a/src/test/run-pass/issue-16668.rs +++ b/src/test/run-pass/issue-16668.rs @@ -11,7 +11,6 @@ // ignore-pretty #![allow(unknown_features)] -#![feature(unboxed_closures)] struct Parser<'a, I, O> { parse: Box Result + 'a> diff --git a/src/test/run-pass/issue-16774.rs b/src/test/run-pass/issue-16774.rs index 627717ab1cd..9ec5910c2f6 100644 --- a/src/test/run-pass/issue-16774.rs +++ b/src/test/run-pass/issue-16774.rs @@ -12,7 +12,6 @@ #![allow(unknown_features)] #![feature(box_syntax)] #![feature(box_patterns)] -#![feature(unboxed_closures)] use std::ops::{Deref, DerefMut}; diff --git a/src/test/run-pass/issue-17816.rs b/src/test/run-pass/issue-17816.rs index 8e3cb414566..a9aa4cdd4f6 100644 --- a/src/test/run-pass/issue-17816.rs +++ b/src/test/run-pass/issue-17816.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - use std::marker::PhantomData; fn main() { diff --git a/src/test/run-pass/issue-18652.rs b/src/test/run-pass/issue-18652.rs index 8ab645e54ad..cea0beaf5f0 100644 --- a/src/test/run-pass/issue-18652.rs +++ b/src/test/run-pass/issue-18652.rs @@ -12,9 +12,6 @@ // once closure as an optimization by trans. This used to hit an // incorrect assert. - -#![feature(unboxed_closures)] - fn main() { let x = 2u8; let y = 3u8; diff --git a/src/test/run-pass/issue-18685.rs b/src/test/run-pass/issue-18685.rs index e4537e158d1..b569dbc8062 100644 --- a/src/test/run-pass/issue-18685.rs +++ b/src/test/run-pass/issue-18685.rs @@ -13,8 +13,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - trait Tr { fn foo(&self); diff --git a/src/test/run-pass/issue-18711.rs b/src/test/run-pass/issue-18711.rs index 277ad3260c5..8239d74d6df 100644 --- a/src/test/run-pass/issue-18711.rs +++ b/src/test/run-pass/issue-18711.rs @@ -13,8 +13,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - // aux-build:issue-18711.rs extern crate issue_18711 as issue; diff --git a/src/test/run-pass/issue-19127.rs b/src/test/run-pass/issue-19127.rs index c5eb5069328..8d169917cad 100644 --- a/src/test/run-pass/issue-19127.rs +++ b/src/test/run-pass/issue-19127.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - fn foo T>(f: F) {} fn id<'a>(input: &'a u8) -> &'a u8 { input } diff --git a/src/test/run-pass/issue-19135.rs b/src/test/run-pass/issue-19135.rs index 5e6dd567d63..ca2098138ef 100644 --- a/src/test/run-pass/issue-19135.rs +++ b/src/test/run-pass/issue-19135.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - use std::marker::PhantomData; #[derive(Debug)] diff --git a/src/test/run-pass/mir_trans_calls.rs b/src/test/run-pass/mir_trans_calls.rs index ca3294a87ad..7ff684a5ef3 100644 --- a/src/test/run-pass/mir_trans_calls.rs +++ b/src/test/run-pass/mir_trans_calls.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs, unboxed_closures, fn_traits)] +#![feature(rustc_attrs, fn_traits)] #[rustc_mir] fn test1(a: isize, b: (i32, i32), c: &[i32]) -> (isize, (i32, i32), &[i32]) { diff --git a/src/test/run-pass/trait-bounds-in-arc.rs b/src/test/run-pass/trait-bounds-in-arc.rs index 24dc73d4a43..0de6fbc91cc 100644 --- a/src/test/run-pass/trait-bounds-in-arc.rs +++ b/src/test/run-pass/trait-bounds-in-arc.rs @@ -16,7 +16,6 @@ #![allow(unknown_features)] #![feature(box_syntax, std_misc)] -#![feature(unboxed_closures)] use std::sync::Arc; use std::sync::mpsc::channel; diff --git a/src/test/run-pass/type-id-higher-rank.rs b/src/test/run-pass/type-id-higher-rank.rs index 3030833c772..c29fb5e86f5 100644 --- a/src/test/run-pass/type-id-higher-rank.rs +++ b/src/test/run-pass/type-id-higher-rank.rs @@ -12,7 +12,7 @@ // Also acts as a regression test for an ICE (issue #19791) -#![feature(unboxed_closures, core)] +#![feature(core)] use std::any::{Any, TypeId}; diff --git a/src/test/run-pass/unboxed-closures-all-traits.rs b/src/test/run-pass/unboxed-closures-all-traits.rs index c28d4f463e5..201500d0c62 100644 --- a/src/test/run-pass/unboxed-closures-all-traits.rs +++ b/src/test/run-pass/unboxed-closures-all-traits.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(lang_items, unboxed_closures)] +#![feature(lang_items)] fn a isize>(f: F) -> isize { f(1, 2) diff --git a/src/test/run-pass/unboxed-closures-blanket-fn-mut.rs b/src/test/run-pass/unboxed-closures-blanket-fn-mut.rs index 54c92900c89..23ec0cb5f60 100644 --- a/src/test/run-pass/unboxed-closures-blanket-fn-mut.rs +++ b/src/test/run-pass/unboxed-closures-blanket-fn-mut.rs @@ -10,8 +10,7 @@ // Test that you can supply `&F` where `F: FnMut()`. - -#![feature(lang_items, unboxed_closures)] +#![feature(lang_items)] fn a i32>(mut f: F) -> i32 { f() diff --git a/src/test/run-pass/unboxed-closures-blanket-fn.rs b/src/test/run-pass/unboxed-closures-blanket-fn.rs index eb474473094..2aa48e7d2ad 100644 --- a/src/test/run-pass/unboxed-closures-blanket-fn.rs +++ b/src/test/run-pass/unboxed-closures-blanket-fn.rs @@ -10,8 +10,7 @@ // Test that you can supply `&F` where `F: Fn()`. - -#![feature(lang_items, unboxed_closures)] +#![feature(lang_items)] fn a i32>(f: F) -> i32 { f() diff --git a/src/test/run-pass/unboxed-closures-boxed.rs b/src/test/run-pass/unboxed-closures-boxed.rs index 5dea6a7c6db..069f26841d2 100644 --- a/src/test/run-pass/unboxed-closures-boxed.rs +++ b/src/test/run-pass/unboxed-closures-boxed.rs @@ -10,7 +10,6 @@ #![allow(unknown_features)] #![feature(box_syntax)] -#![feature(unboxed_closures)] use std::ops::FnMut; diff --git a/src/test/run-pass/unboxed-closures-by-ref.rs b/src/test/run-pass/unboxed-closures-by-ref.rs index e3ddfdbac00..b251215909a 100644 --- a/src/test/run-pass/unboxed-closures-by-ref.rs +++ b/src/test/run-pass/unboxed-closures-by-ref.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unboxed_closures)] - // Test by-ref capture of environment in unboxed closure types fn call_fn(f: F) { diff --git a/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs b/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs index 64236ce563b..56c53bcafce 100644 --- a/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs +++ b/src/test/run-pass/unboxed-closures-call-fn-autoderef.rs @@ -10,9 +10,6 @@ // Test that the call operator autoderefs when calling a bounded type parameter. - -#![feature(unboxed_closures)] - use std::ops::FnMut; fn call_with_2(x: &fn(isize) -> isize) -> isize diff --git a/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs b/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs index 67ab84f0276..63667ec11d6 100644 --- a/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs +++ b/src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs @@ -10,9 +10,6 @@ // Test that the call operator autoderefs when calling a bounded type parameter. - -#![feature(unboxed_closures)] - use std::ops::FnMut; fn call_with_2(x: &mut F) -> isize diff --git a/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs b/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs index c82026235c2..a92fb05306f 100644 --- a/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs +++ b/src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs @@ -11,7 +11,6 @@ // Test that the call operator autoderefs when calling to an object type. #![allow(unknown_features)] -#![feature(unboxed_closures)] use std::ops::FnMut; diff --git a/src/test/run-pass/unboxed-closures-call-sugar-object.rs b/src/test/run-pass/unboxed-closures-call-sugar-object.rs index 629da1091ac..5dd2343cfd1 100644 --- a/src/test/run-pass/unboxed-closures-call-sugar-object.rs +++ b/src/test/run-pass/unboxed-closures-call-sugar-object.rs @@ -9,7 +9,6 @@ // except according to those terms. #![allow(unknown_features)] -#![feature(unboxed_closures)] use std::ops::FnMut; diff --git a/src/test/run-pass/unboxed-closures-counter-not-moved.rs b/src/test/run-pass/unboxed-closures-counter-not-moved.rs index cb5f190bcd7..0b85916d224 100644 --- a/src/test/run-pass/unboxed-closures-counter-not-moved.rs +++ b/src/test/run-pass/unboxed-closures-counter-not-moved.rs @@ -10,7 +10,6 @@ // Test that we mutate a counter on the stack only when we expect to. - fn call(f: F) where F : FnOnce() { f(); } diff --git a/src/test/run-pass/unboxed-closures-direct-sugary-call.rs b/src/test/run-pass/unboxed-closures-direct-sugary-call.rs index c91aa6ed0d9..c8da4a6992a 100644 --- a/src/test/run-pass/unboxed-closures-direct-sugary-call.rs +++ b/src/test/run-pass/unboxed-closures-direct-sugary-call.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - fn main() { let mut unboxed = || {}; unboxed(); diff --git a/src/test/run-pass/unboxed-closures-drop.rs b/src/test/run-pass/unboxed-closures-drop.rs index 78f4905aef9..57f2f87e246 100644 --- a/src/test/run-pass/unboxed-closures-drop.rs +++ b/src/test/run-pass/unboxed-closures-drop.rs @@ -11,9 +11,6 @@ // A battery of tests to ensure destructors of unboxed closure environments // run at the right times. - -#![feature(unboxed_closures)] - static mut DROP_COUNT: usize = 0; fn drop_count() -> usize { diff --git a/src/test/run-pass/unboxed-closures-extern-fn.rs b/src/test/run-pass/unboxed-closures-extern-fn.rs index 57acbae4ce6..eddb6080d17 100644 --- a/src/test/run-pass/unboxed-closures-extern-fn.rs +++ b/src/test/run-pass/unboxed-closures-extern-fn.rs @@ -10,10 +10,6 @@ // Checks that extern fn pointers implement the full range of Fn traits. - -#![feature(unboxed_closures)] -#![feature(unboxed_closures)] - use std::ops::{Fn,FnMut,FnOnce}; fn square(x: isize) -> isize { x * x } diff --git a/src/test/run-pass/unboxed-closures-fn-as-fnmut-and-fnonce.rs b/src/test/run-pass/unboxed-closures-fn-as-fnmut-and-fnonce.rs index 2e63c600a46..f90aced3dbe 100644 --- a/src/test/run-pass/unboxed-closures-fn-as-fnmut-and-fnonce.rs +++ b/src/test/run-pass/unboxed-closures-fn-as-fnmut-and-fnonce.rs @@ -11,7 +11,6 @@ // Checks that the Fn trait hierarchy rules permit // any Fn trait to be used where Fn is implemented. - #![feature(unboxed_closures, fn_traits)] use std::ops::{Fn,FnMut,FnOnce}; diff --git a/src/test/run-pass/unboxed-closures-fnmut-as-fnonce.rs b/src/test/run-pass/unboxed-closures-fnmut-as-fnonce.rs index ce93fcafc9e..0a977cef442 100644 --- a/src/test/run-pass/unboxed-closures-fnmut-as-fnonce.rs +++ b/src/test/run-pass/unboxed-closures-fnmut-as-fnonce.rs @@ -11,7 +11,6 @@ // Checks that the Fn trait hierarchy rules permit // FnMut or FnOnce to be used where FnMut is implemented. - #![feature(unboxed_closures, fn_traits)] struct S; diff --git a/src/test/run-pass/unboxed-closures-generic.rs b/src/test/run-pass/unboxed-closures-generic.rs index 47936ba9382..01c81ef98d5 100644 --- a/src/test/run-pass/unboxed-closures-generic.rs +++ b/src/test/run-pass/unboxed-closures-generic.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unboxed_closures)] - use std::ops::FnMut; fn call_iti32>(y: i32, mut f: F) -> i32 { diff --git a/src/test/run-pass/unboxed-closures-infer-fnmut-calling-fnmut.rs b/src/test/run-pass/unboxed-closures-infer-fnmut-calling-fnmut.rs index 2da899ed95b..17833033492 100644 --- a/src/test/run-pass/unboxed-closures-infer-fnmut-calling-fnmut.rs +++ b/src/test/run-pass/unboxed-closures-infer-fnmut-calling-fnmut.rs @@ -11,7 +11,6 @@ // Test that we are able to infer a suitable kind for this closure // that is just called (`FnMut`). - fn main() { let mut counter = 0; diff --git a/src/test/run-pass/unboxed-closures-infer-fnmut-move.rs b/src/test/run-pass/unboxed-closures-infer-fnmut-move.rs index 32fc3433e84..794527249bf 100644 --- a/src/test/run-pass/unboxed-closures-infer-fnmut-move.rs +++ b/src/test/run-pass/unboxed-closures-infer-fnmut-move.rs @@ -11,7 +11,6 @@ // Test that we are able to infer a suitable kind for this `move` // closure that is just called (`FnMut`). - fn main() { let mut counter = 0; diff --git a/src/test/run-pass/unboxed-closures-infer-fnmut.rs b/src/test/run-pass/unboxed-closures-infer-fnmut.rs index a8469f4019a..67f36b9a920 100644 --- a/src/test/run-pass/unboxed-closures-infer-fnmut.rs +++ b/src/test/run-pass/unboxed-closures-infer-fnmut.rs @@ -11,7 +11,6 @@ // Test that we are able to infer a suitable kind for this closure // that is just called (`FnMut`). - fn main() { let mut counter = 0; diff --git a/src/test/run-pass/unboxed-closures-infer-kind.rs b/src/test/run-pass/unboxed-closures-infer-kind.rs index fa668475f58..c04df7ed5f8 100644 --- a/src/test/run-pass/unboxed-closures-infer-kind.rs +++ b/src/test/run-pass/unboxed-closures-infer-kind.rs @@ -11,9 +11,6 @@ // Test that we can infer the "kind" of an unboxed closure based on // the expected type. - -#![feature(unboxed_closures)] - // Test by-ref capture of environment in unboxed closure types fn call_fn(f: F) { diff --git a/src/test/run-pass/unboxed-closures-infer-upvar.rs b/src/test/run-pass/unboxed-closures-infer-upvar.rs index f2423145b19..1401fe7470b 100644 --- a/src/test/run-pass/unboxed-closures-infer-upvar.rs +++ b/src/test/run-pass/unboxed-closures-infer-upvar.rs @@ -11,7 +11,6 @@ // Test that the type variable in the type(`Vec<_>`) of a closed over // variable does not interfere with type inference. - fn f(mut f: F) { f(); } diff --git a/src/test/run-pass/unboxed-closures-move-mutable.rs b/src/test/run-pass/unboxed-closures-move-mutable.rs index 1aca3174e1f..a55b0a0185e 100644 --- a/src/test/run-pass/unboxed-closures-move-mutable.rs +++ b/src/test/run-pass/unboxed-closures-move-mutable.rs @@ -10,7 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] #![deny(unused_mut)] // Test that mutating a mutable upvar in a capture-by-value unboxed diff --git a/src/test/run-pass/unboxed-closures-move-some-upvars-in-by-ref-closure.rs b/src/test/run-pass/unboxed-closures-move-some-upvars-in-by-ref-closure.rs index e2b286738e7..99663646254 100644 --- a/src/test/run-pass/unboxed-closures-move-some-upvars-in-by-ref-closure.rs +++ b/src/test/run-pass/unboxed-closures-move-some-upvars-in-by-ref-closure.rs @@ -11,7 +11,6 @@ // Test that in a by-ref once closure we move some variables even as // we capture others by mutable reference. - fn call(f: F) where F : FnOnce() { f(); } diff --git a/src/test/run-pass/unboxed-closures-simple.rs b/src/test/run-pass/unboxed-closures-simple.rs index ec341981669..429afb95248 100644 --- a/src/test/run-pass/unboxed-closures-simple.rs +++ b/src/test/run-pass/unboxed-closures-simple.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unboxed_closures)] - use std::ops::FnMut; pub fn main() { diff --git a/src/test/run-pass/unboxed-closures-single-word-env.rs b/src/test/run-pass/unboxed-closures-single-word-env.rs index 166054e88b7..3ed055a7884 100644 --- a/src/test/run-pass/unboxed-closures-single-word-env.rs +++ b/src/test/run-pass/unboxed-closures-single-word-env.rs @@ -11,9 +11,6 @@ // Ensures that single-word environments work right in unboxed closures. // These take a different path in codegen. - -#![feature(unboxed_closures)] - fn a isize>(f: F) -> isize { f(1, 2) } diff --git a/src/test/run-pass/unboxed-closures-static-call-fn-once.rs b/src/test/run-pass/unboxed-closures-static-call-fn-once.rs index e90a3443610..c13e9513ce3 100644 --- a/src/test/run-pass/unboxed-closures-static-call-fn-once.rs +++ b/src/test/run-pass/unboxed-closures-static-call-fn-once.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - fn main() { let onetime = |x| x; onetime(0); diff --git a/src/test/run-pass/unboxed-closures-sugar-object.rs b/src/test/run-pass/unboxed-closures-sugar-object.rs index 49b9b7f061e..b7d367f2353 100644 --- a/src/test/run-pass/unboxed-closures-sugar-object.rs +++ b/src/test/run-pass/unboxed-closures-sugar-object.rs @@ -10,9 +10,7 @@ // Test unboxed closure sugar used in object types. - #![allow(dead_code)] -#![feature(unboxed_closures)] struct Foo { t: T, u: U diff --git a/src/test/run-pass/unboxed-closures-unique-type-id.rs b/src/test/run-pass/unboxed-closures-unique-type-id.rs index 30c45fc766a..40071ec9754 100644 --- a/src/test/run-pass/unboxed-closures-unique-type-id.rs +++ b/src/test/run-pass/unboxed-closures-unique-type-id.rs @@ -19,9 +19,6 @@ // // compile-flags: -g - -#![feature(unboxed_closures)] - use std::ptr; pub fn replace_map<'a, T, F>(src: &mut T, prod: F) where F: FnOnce(T) -> T { diff --git a/src/test/run-pass/unboxed-closures-zero-args.rs b/src/test/run-pass/unboxed-closures-zero-args.rs index cb3a18a18c1..9e6a7cce1fd 100644 --- a/src/test/run-pass/unboxed-closures-zero-args.rs +++ b/src/test/run-pass/unboxed-closures-zero-args.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - fn main() { let mut zero = || {}; let () = zero(); diff --git a/src/test/run-pass/where-clauses-unboxed-closures.rs b/src/test/run-pass/where-clauses-unboxed-closures.rs index c509cbe2a5e..8a775caaac6 100644 --- a/src/test/run-pass/where-clauses-unboxed-closures.rs +++ b/src/test/run-pass/where-clauses-unboxed-closures.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unboxed_closures)] - struct Bencher; // ICE