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/libstd/thread_local/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstd/thread_local') diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 9de5fd1c770..0ec241a65e2 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -335,6 +335,7 @@ mod imp { use ptr; #[doc(hidden)] + #[stable(since = "1.0.0", feature = "rust1")] pub struct Key { // Place the inner bits in an `UnsafeCell` to currently get around the // "only Sync statics" restriction. This allows any type to be placed in @@ -342,11 +343,14 @@ mod imp { // // Note that all access requires `T: 'static` so it can't be a type with // any borrowed pointers still. + #[stable(since = "1.0.0", feature = "rust1")] pub inner: UnsafeCell, // Metadata to keep track of the state of the destructor. Remember that // these variables are thread-local, not global. + #[stable(since = "1.0.0", feature = "rust1")] pub dtor_registered: UnsafeCell, // should be Cell + #[stable(since = "1.0.0", feature = "rust1")] pub dtor_running: UnsafeCell, // should be Cell } @@ -468,12 +472,15 @@ mod imp { use sys_common::thread_local::StaticKey as OsStaticKey; #[doc(hidden)] + #[stable(since = "1.0.0", feature = "rust1")] pub struct Key { // Statically allocated initialization expression, using an `UnsafeCell` // for the same reasons as above. + #[stable(since = "1.0.0", feature = "rust1")] pub inner: UnsafeCell, // OS-TLS key that we'll use to key off. + #[stable(since = "1.0.0", feature = "rust1")] pub os: OsStaticKey, } -- cgit 1.4.1-3-g733a5