From bbbb571fee01532f63b105150654db8db0b01bf7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 9 Feb 2015 16:33:19 -0800 Subject: rustc: Fix a number of stability lint holes There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change] --- src/libtest/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libtest') diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index f3edd90b4fa..fb22067ee94 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -40,6 +40,7 @@ #![feature(hash)] #![feature(int_uint)] #![feature(io)] +#![feature(os)] #![feature(path)] #![feature(rustc_private)] #![feature(staged_api)] @@ -265,7 +266,8 @@ pub fn test_main(args: &[String], tests: Vec ) { // a ~[TestDescAndFn] is used in order to effect ownership-transfer // semantics into parallel test runners, which in turn requires a ~[] // rather than a &[]. -pub fn test_main_static(args: &[String], tests: &[TestDescAndFn]) { +pub fn test_main_static(args: env::Args, tests: &[TestDescAndFn]) { + let args = args.map(|s| s.into_string().unwrap()).collect::>(); let owned_tests = tests.iter().map(|t| { match t.testfn { StaticTestFn(f) => TestDescAndFn { testfn: StaticTestFn(f), desc: t.desc.clone() }, @@ -273,7 +275,7 @@ pub fn test_main_static(args: &[String], tests: &[TestDescAndFn]) { _ => panic!("non-static tests passed to test::test_main_static") } }).collect(); - test_main(args, owned_tests) + test_main(&args, owned_tests) } #[derive(Copy)] -- cgit 1.4.1-3-g733a5