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:👿: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]
This commit is contained in:
Alex Crichton 2015-02-09 16:33:19 -08:00
parent 446bc899b2
commit bbbb571fee
35 changed files with 187 additions and 127 deletions

View file

@ -61,7 +61,7 @@ use core::cell::Cell;
use core::marker;
use core::mem;
use core::ptr;
use core::uint;
use core::usize;
use sync::mpsc::{Receiver, RecvError};
use sync::mpsc::blocking::{self, SignalToken};
@ -228,7 +228,7 @@ impl Select {
// A rewrite should focus on avoiding a yield loop, and for now this
// implementation is tying us over to a more efficient "don't
// iterate over everything every time" implementation.
let mut ready_id = uint::MAX;
let mut ready_id = usize::MAX;
for handle in self.iter() {
if (*handle).packet.abort_selection() {
ready_id = (*handle).id;
@ -236,7 +236,7 @@ impl Select {
}
// We must have found a ready receiver
assert!(ready_id != uint::MAX);
assert!(ready_id != usize::MAX);
return ready_id;
}
}

View file

@ -23,7 +23,7 @@ pub use self::Failure::*;
use core::prelude::*;
use core::cmp;
use core::int;
use core::isize;
use sync::atomic::{AtomicUsize, AtomicIsize, AtomicBool, Ordering};
use sync::mpsc::blocking::{self, SignalToken};
@ -33,17 +33,17 @@ use sync::mpsc::select::StartResult;
use sync::{Mutex, MutexGuard};
use thread::Thread;
const DISCONNECTED: int = int::MIN;
const FUDGE: int = 1024;
const DISCONNECTED: isize = isize::MIN;
const FUDGE: isize = 1024;
#[cfg(test)]
const MAX_STEALS: int = 5;
const MAX_STEALS: isize = 5;
#[cfg(not(test))]
const MAX_STEALS: int = 1 << 20;
const MAX_STEALS: isize = 1 << 20;
pub struct Packet<T> {
queue: mpsc::Queue<T>,
cnt: AtomicIsize, // How many items are on this channel
steals: int, // How many times has a port received without blocking?
steals: isize, // How many times has a port received without blocking?
to_wake: AtomicUsize, // SignalToken for wake up
// The number of channels which are currently using this packet.

View file

@ -25,7 +25,7 @@ use self::Message::*;
use core::prelude::*;
use core::cmp;
use core::int;
use core::isize;
use thread::Thread;
use sync::atomic::{AtomicIsize, AtomicUsize, Ordering, AtomicBool};
@ -33,11 +33,11 @@ use sync::mpsc::Receiver;
use sync::mpsc::blocking::{self, SignalToken};
use sync::mpsc::spsc_queue as spsc;
const DISCONNECTED: int = int::MIN;
const DISCONNECTED: isize = isize::MIN;
#[cfg(test)]
const MAX_STEALS: int = 5;
const MAX_STEALS: isize = 5;
#[cfg(not(test))]
const MAX_STEALS: int = 1 << 20;
const MAX_STEALS: isize = 1 << 20;
pub struct Packet<T> {
queue: spsc::Queue<Message<T>>, // internal queue for all message