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:
parent
446bc899b2
commit
bbbb571fee
35 changed files with 187 additions and 127 deletions
|
|
@ -12,7 +12,7 @@ use std::collections::HashSet;
|
|||
use rustc::util::nodemap::NodeSet;
|
||||
use std::cmp;
|
||||
use std::string::String;
|
||||
use std::uint;
|
||||
use std::usize;
|
||||
use syntax::ast;
|
||||
use syntax::ast_util;
|
||||
|
||||
|
|
@ -310,7 +310,7 @@ pub fn unindent(s: &str) -> String {
|
|||
let lines = s.lines_any().collect::<Vec<&str> >();
|
||||
let mut saw_first_line = false;
|
||||
let mut saw_second_line = false;
|
||||
let min_indent = lines.iter().fold(uint::MAX, |min_indent, line| {
|
||||
let min_indent = lines.iter().fold(usize::MAX, |min_indent, line| {
|
||||
|
||||
// After we see the first non-whitespace line, look at
|
||||
// the line we have. If it is not whitespace, and therefore
|
||||
|
|
@ -322,7 +322,7 @@ pub fn unindent(s: &str) -> String {
|
|||
!line.chars().all(|c| c.is_whitespace());
|
||||
|
||||
let min_indent = if ignore_previous_indents {
|
||||
uint::MAX
|
||||
usize::MAX
|
||||
} else {
|
||||
min_indent
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue