Skip to content

Commit 110d10b

Browse files
committed
---
yaml --- r: 174454 b: refs/heads/batch c: d2833b8 h: refs/heads/master v: v3
1 parent a717d4a commit 110d10b

File tree

8 files changed

+48
-32
lines changed

8 files changed

+48
-32
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: 5431727b6e521548419ec2606ef22ffa43097f72
32+
refs/heads/batch: d2833b87d0a35f9fe6b786e19eba2b78534cc465
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Nano configuration for Rust
2+
# Copyright 2015 The Rust Project Developers.
3+
#
4+
# NOTE: Rules are applied in order: later rules re-colorize matching text.
5+
syntax "rust" "\.rs"
6+
7+
# function definition
8+
color magenta "fn [a-z0-9_]+"
9+
10+
# Reserved words
11+
color yellow "\<(abstract|alignof|as|be|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\>"
12+
13+
# macros
14+
color red "[a-z_]+!"
15+
16+
# Constants
17+
color magenta "[A-Z][A-Z_]+"
18+
19+
# Traits/Enums/Structs/Types/etc.
20+
color magenta "[A-Z][a-z]+"
21+
22+
# Strings
23+
color green "\".*\""
24+
color green start="\".*\\$" end=".*\""
25+
# NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
26+
color green start="r#+\"" end="\"#+"
27+
28+
# Comments
29+
color blue "//.*"
30+
31+
# Attributes
32+
color magenta start="#!\[" end="\]"
33+
34+
# Some common markers
35+
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"

branches/batch/src/libserialize/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
//!
3535
//! An object is a series of string keys mapping to values, in `"key": value` format.
3636
//! Arrays are enclosed in square brackets ([ ... ]) and objects in curly brackets ({ ... }).
37-
//! A simple JSON document encoding a person, his/her age, address and phone numbers could look like
37+
//! A simple JSON document encoding a person, their age, address and phone numbers could look like
3838
//!
3939
//! ```ignore
4040
//! {

branches/batch/src/libstd/collections/hash/map.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,23 +2112,6 @@ mod test_map {
21122112
assert_eq!(m.remove(&0), Some(0));
21132113
}
21142114

2115-
#[test]
2116-
fn test_find_equiv() {
2117-
let mut m = HashMap::new();
2118-
2119-
let (foo, bar, baz) = (1i,2i,3i);
2120-
m.insert("foo".to_string(), foo);
2121-
m.insert("bar".to_string(), bar);
2122-
m.insert("baz".to_string(), baz);
2123-
2124-
2125-
assert_eq!(m.get("foo"), Some(&foo));
2126-
assert_eq!(m.get("bar"), Some(&bar));
2127-
assert_eq!(m.get("baz"), Some(&baz));
2128-
2129-
assert_eq!(m.get("qux"), None);
2130-
}
2131-
21322115
#[test]
21332116
fn test_from_iter() {
21342117
let xs = [(1i, 1i), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];

branches/batch/src/libsyntax/parse/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,10 @@ pub fn file_to_filemap(sess: &ParseSess, path: &Path, spanopt: Option<Span>)
253253
let bytes = match File::open(path).read_to_end() {
254254
Ok(bytes) => bytes,
255255
Err(e) => {
256-
err(&format!("couldn't read {:?}: {:?}",
256+
let error_msg = e.desc;
257+
err(&format!("couldn't read {:?}: {}",
257258
path.display(),
258-
e)[]);
259+
error_msg)[]);
259260
unreachable!()
260261
}
261262
};

branches/batch/src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,7 @@ impl<'a> Parser<'a> {
21392139

21402140
let ex: Expr_;
21412141

2142+
// Note: when adding new syntax here, don't forget to adjust Token::can_begin_expr().
21422143
match self.token {
21432144
token::OpenDelim(token::Paren) => {
21442145
self.bump();
@@ -2776,6 +2777,7 @@ impl<'a> Parser<'a> {
27762777
let lo = self.span.lo;
27772778
let hi;
27782779

2780+
// Note: when adding new unary operators, don't forget to adjust Token::can_begin_expr()
27792781
let ex;
27802782
match self.token {
27812783
token::Not => {
@@ -5536,13 +5538,6 @@ impl<'a> Parser<'a> {
55365538
(id, ItemEnum(enum_definition, generics), None)
55375539
}
55385540

5539-
fn fn_expr_lookahead(tok: &token::Token) -> bool {
5540-
match *tok {
5541-
token::OpenDelim(token::Paren) | token::At | token::Tilde | token::BinOp(_) => true,
5542-
_ => false
5543-
}
5544-
}
5545-
55465541
/// Parses a string as an ABI spec on an extern type or module. Consumes
55475542
/// the `extern` keyword, if one is found.
55485543
fn parse_opt_abi(&mut self) -> Option<abi::Abi> {
@@ -5715,8 +5710,7 @@ impl<'a> Parser<'a> {
57155710
maybe_append(attrs, extra_attrs));
57165711
return IoviItem(item);
57175712
}
5718-
if self.token.is_keyword(keywords::Fn) &&
5719-
self.look_ahead(1, |f| !Parser::fn_expr_lookahead(f)) {
5713+
if self.token.is_keyword(keywords::Fn) {
57205714
// FUNCTION ITEM
57215715
self.bump();
57225716
let (ident, item_, extra_attrs) =

branches/batch/src/libsyntax/parse/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ impl Token {
183183
Underscore => true,
184184
Tilde => true,
185185
Literal(_, _) => true,
186-
Pound => true,
187-
At => true,
188186
Not => true,
189187
BinOp(Minus) => true,
190188
BinOp(Star) => true,
191189
BinOp(And) => true,
192190
BinOp(Or) => true, // in lambda syntax
193191
OrOr => true, // in lambda syntax
192+
AndAnd => true, // double borrow
193+
DotDot => true, // range notation
194194
ModSep => true,
195195
Interpolated(NtExpr(..)) => true,
196196
Interpolated(NtIdent(..)) => true,

branches/batch/src/test/run-pass/range.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
fn foo() -> int { 42 }
1414

15+
// Test that range syntax works in return statements
16+
fn return_range_to() -> ::std::ops::RangeTo<i32> { return ..1; }
17+
1518
pub fn main() {
1619
let mut count = 0;
1720
for i in 0u..10 {

0 commit comments

Comments
 (0)