about summary refs log tree commit diff
path: root/src/libstd/sync/once.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-02-09 16:33:19 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-02-11 12:14:59 -0800
commitbbbb571fee01532f63b105150654db8db0b01bf7 (patch)
treee3d8b2c3105e2c0dfb861ccc43b5f02d876c8518 /src/libstd/sync/once.rs
parent446bc899b28e988f4252beca0d1858e7f7d866b1 (diff)
downloadrust-bbbb571fee01532f63b105150654db8db0b01bf7.tar.gz
rust-bbbb571fee01532f63b105150654db8db0b01bf7.zip
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]
Diffstat (limited to 'src/libstd/sync/once.rs')
-rw-r--r--src/libstd/sync/once.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs
index 2df211f3768..29c2051e5ad 100644
--- a/src/libstd/sync/once.rs
+++ b/src/libstd/sync/once.rs
@@ -13,7 +13,7 @@
 //! This primitive is meant to be used to run one-time initialization. An
 //! example use case would be for initializing an FFI library.
 
-use int;
+use isize;
 use marker::Sync;
 use mem::drop;
 use ops::FnOnce;
@@ -99,9 +99,9 @@ impl Once {
 
         let prev = self.cnt.fetch_add(1, Ordering::SeqCst);
         if prev < 0 {
-            // Make sure we never overflow, we'll never have int::MIN
+            // Make sure we never overflow, we'll never have isize::MIN
             // simultaneous calls to `call_once` to make this value go back to 0
-            self.cnt.store(int::MIN, Ordering::SeqCst);
+            self.cnt.store(isize::MIN, Ordering::SeqCst);
             return
         }
 
@@ -111,7 +111,7 @@ impl Once {
         let guard = self.mutex.lock();
         if self.cnt.load(Ordering::SeqCst) > 0 {
             f();
-            let prev = self.cnt.swap(int::MIN, Ordering::SeqCst);
+            let prev = self.cnt.swap(isize::MIN, Ordering::SeqCst);
             self.lock_cnt.store(prev, Ordering::SeqCst);
         }
         drop(guard);