Auto merge of #21677 - japaric:no-range, r=alexcrichton

Note: Do not merge until we get a newer snapshot that includes #21374

There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672).

r? @alexcrichton
This commit is contained in:
bors
2015-01-29 16:28:52 +00:00
366 changed files with 1314 additions and 1337 deletions

View File

@@ -52,7 +52,7 @@ pub trait Reader {
}
}
#[derive(Clone, PartialEq, Eq, Show)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct TokenAndSpan {
pub tok: token::Token,
pub sp: Span,
@@ -732,7 +732,7 @@ impl<'a> StringReader<'a> {
let start_bpos = self.last_pos;
let mut accum_int = 0;
for _ in range(0, n_digits) {
for _ in 0..n_digits {
if self.is_eof() {
let last_bpos = self.last_pos;
self.fatal_span_(start_bpos, last_bpos, "unterminated numeric character escape");
@@ -1217,7 +1217,7 @@ impl<'a> StringReader<'a> {
}
//if self.curr_is('"') {
//content_end_bpos = self.last_pos;
//for _ in range(0, hash_count) {
//for _ in 0..hash_count {
//self.bump();
//if !self.curr_is('#') {
//continue 'outer;
@@ -1225,7 +1225,7 @@ impl<'a> StringReader<'a> {
match c {
'"' => {
content_end_bpos = self.last_pos;
for _ in range(0, hash_count) {
for _ in 0..hash_count {
self.bump();
if !self.curr_is('#') {
continue 'outer;
@@ -1402,7 +1402,7 @@ impl<'a> StringReader<'a> {
},
Some('"') => {
content_end_bpos = self.last_pos;
for _ in range(0, hash_count) {
for _ in 0..hash_count {
self.bump();
if !self.curr_is('#') {
continue 'outer;

View File

@@ -472,7 +472,7 @@ pub fn str_lit(lit: &str) -> String {
} else {
// otherwise, a normal escape
let (c, n) = char_lit(&lit[i..]);
for _ in range(0, n - 1) { // we don't need to move past the first \
for _ in 0..n - 1 { // we don't need to move past the first \
chars.next();
}
res.push(c);
@@ -635,7 +635,7 @@ pub fn binary_lit(lit: &str) -> Rc<Vec<u8>> {
// otherwise, a normal escape
let (c, n) = byte_lit(&lit[i..]);
// we don't need to move past the first \
for _ in range(0, n - 1) {
for _ in 0..n - 1 {
chars.next();
}
res.push(c);

View File

@@ -29,7 +29,7 @@ use std::path::BytesContainer;
use std::rc::Rc;
#[allow(non_camel_case_types)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
pub enum BinOpToken {
Plus,
Minus,
@@ -44,7 +44,7 @@ pub enum BinOpToken {
}
/// A delimiter token
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
pub enum DelimToken {
/// A round parenthesis: `(` or `)`
Paren,
@@ -54,14 +54,14 @@ pub enum DelimToken {
Brace,
}
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
pub enum IdentStyle {
/// `::` follows the identifier with no whitespace in-between.
ModName,
Plain,
}
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
pub enum SpecialMacroVar {
/// `$crate` will be filled in with the name of the crate a macro was
/// imported from, if any.
@@ -76,7 +76,7 @@ impl SpecialMacroVar {
}
}
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)]
pub enum Lit {
Byte(ast::Name),
Char(ast::Name),
@@ -102,7 +102,7 @@ impl Lit {
}
#[allow(non_camel_case_types)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show)]
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug)]
pub enum Token {
/* Expression-operator symbols. */
Eq,