Skip to content

Commit b379b93

Browse files
committed
---
yaml --- r: 95267 b: refs/heads/dist-snap c: 0cca359 h: refs/heads/master i: 95265: 86de4bb 95263: cadaf31 v: v3
1 parent 800515c commit b379b93

File tree

7 files changed

+21
-93
lines changed

7 files changed

+21
-93
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: e42e32291ea779a30818521e8aea9693899b8188
9+
refs/heads/dist-snap: 0cca359da690d357ae3447c0e18cf5fab4ee8732
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libstd/num/num.rs

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,9 @@ pub trait ToPrimitive {
404404

405405
/// Converts the value of `self` to an `u64`.
406406
#[inline]
407-
fn to_u64(&self) -> Option<u64>;
407+
fn to_u64(&self) -> Option<u64> {
408+
self.to_u64().and_then(|x| x.to_u64())
409+
}
408410

409411
/// Converts the value of `self` to an `f32`.
410412
#[inline]
@@ -1479,51 +1481,4 @@ mod tests {
14791481
assert_eq!(third.checked_mul(&3), Some(third * 3));
14801482
assert_eq!(third.checked_mul(&4), None);
14811483
}
1482-
1483-
1484-
#[deriving(Eq)]
1485-
struct Value { x: int }
1486-
1487-
impl ToPrimitive for Value {
1488-
fn to_i64(&self) -> Option<i64> { self.x.to_i64() }
1489-
fn to_u64(&self) -> Option<u64> { self.x.to_u64() }
1490-
}
1491-
1492-
impl FromPrimitive for Value {
1493-
fn from_i64(n: i64) -> Option<Value> { Some(Value { x: n as int }) }
1494-
fn from_u64(n: u64) -> Option<Value> { Some(Value { x: n as int }) }
1495-
}
1496-
1497-
#[test]
1498-
fn test_to_primitive() {
1499-
let value = Value { x: 5 };
1500-
assert_eq!(value.to_int(), Some(5));
1501-
assert_eq!(value.to_i8(), Some(5));
1502-
assert_eq!(value.to_i16(), Some(5));
1503-
assert_eq!(value.to_i32(), Some(5));
1504-
assert_eq!(value.to_i64(), Some(5));
1505-
assert_eq!(value.to_uint(), Some(5));
1506-
assert_eq!(value.to_u8(), Some(5));
1507-
assert_eq!(value.to_u16(), Some(5));
1508-
assert_eq!(value.to_u32(), Some(5));
1509-
assert_eq!(value.to_u64(), Some(5));
1510-
assert_eq!(value.to_f32(), Some(5f32));
1511-
assert_eq!(value.to_f64(), Some(5f64));
1512-
}
1513-
1514-
#[test]
1515-
fn test_from_primitive() {
1516-
assert_eq!(from_int(5), Some(Value { x: 5 }));
1517-
assert_eq!(from_i8(5), Some(Value { x: 5 }));
1518-
assert_eq!(from_i16(5), Some(Value { x: 5 }));
1519-
assert_eq!(from_i32(5), Some(Value { x: 5 }));
1520-
assert_eq!(from_i64(5), Some(Value { x: 5 }));
1521-
assert_eq!(from_uint(5), Some(Value { x: 5 }));
1522-
assert_eq!(from_u8(5), Some(Value { x: 5 }));
1523-
assert_eq!(from_u16(5), Some(Value { x: 5 }));
1524-
assert_eq!(from_u32(5), Some(Value { x: 5 }));
1525-
assert_eq!(from_u64(5), Some(Value { x: 5 }));
1526-
assert_eq!(from_f32(5f32), Some(Value { x: 5 }));
1527-
assert_eq!(from_f64(5f64), Some(Value { x: 5 }));
1528-
}
15291484
}

branches/dist-snap/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ pub fn Parser(sess: @mut ParseSess,
309309
quote_depth: @mut 0,
310310
obsolete_set: @mut HashSet::new(),
311311
mod_path_stack: @mut ~[],
312-
open_braces: @mut ~[]
313312
}
314313
}
315314

@@ -338,8 +337,6 @@ pub struct Parser {
338337
obsolete_set: @mut HashSet<ObsoleteSyntax>,
339338
/// Used to determine the path to externally loaded source files
340339
mod_path_stack: @mut ~[@str],
341-
/// Stack of spans of open delimiters. Used for error message.
342-
open_braces: @mut ~[Span]
343340
}
344341

345342
#[unsafe_destructor]
@@ -2027,18 +2024,12 @@ impl Parser {
20272024

20282025
match *self.token {
20292026
token::EOF => {
2030-
for sp in self.open_braces.iter() {
2031-
self.span_note(*sp, "Did you mean to close this delimiter?");
2032-
}
2033-
// There shouldn't really be a span, but it's easier for the test runner
2034-
// if we give it one
2035-
self.fatal("This file contains an un-closed delimiter ");
2027+
self.fatal("file ended with unbalanced delimiters");
20362028
}
20372029
token::LPAREN | token::LBRACE | token::LBRACKET => {
20382030
let close_delim = token::flip_delimiter(&*self.token);
20392031

20402032
// Parse the open delimiter.
2041-
(*self.open_braces).push(*self.span);
20422033
let mut result = ~[parse_any_tt_tok(self)];
20432034

20442035
let trees =
@@ -2049,7 +2040,6 @@ impl Parser {
20492040

20502041
// Parse the close delimiter.
20512042
result.push(parse_any_tt_tok(self));
2052-
self.open_braces.pop();
20532043

20542044
tt_delim(@mut result)
20552045
}

branches/dist-snap/src/libsyntax/parse/token.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -499,30 +499,11 @@ fn mk_fresh_ident_interner() -> @ident_interner {
499499
@interner::StrInterner::prefill(init_vec)
500500
}
501501

502-
// NOTE remove stage0 pub'ed special cases after next snapshot.
503-
#[cfg(stage0)]
504-
pub static SELF_KEYWORD_NAME: uint = 8;
505-
#[cfg(not(stage0))]
506502
static SELF_KEYWORD_NAME: uint = 8;
507-
#[cfg(stage0)]
508-
pub static STATIC_KEYWORD_NAME: uint = 27;
509-
#[cfg(not(stage0))]
510503
static STATIC_KEYWORD_NAME: uint = 27;
511-
#[cfg(stage0)]
512-
pub static STRICT_KEYWORD_START: uint = 32;
513-
#[cfg(not(stage0))]
514504
static STRICT_KEYWORD_START: uint = 32;
515-
#[cfg(stage0)]
516-
pub static STRICT_KEYWORD_FINAL: uint = 64;
517-
#[cfg(not(stage0))]
518505
static STRICT_KEYWORD_FINAL: uint = 64;
519-
#[cfg(stage0)]
520-
pub static RESERVED_KEYWORD_START: uint = 65;
521-
#[cfg(not(stage0))]
522506
static RESERVED_KEYWORD_START: uint = 65;
523-
#[cfg(stage0)]
524-
pub static RESERVED_KEYWORD_FINAL: uint = 71;
525-
#[cfg(not(stage0))]
526507
static RESERVED_KEYWORD_FINAL: uint = 71;
527508

528509
// if an interner exists in TLS, return it. Otherwise, prepare a

branches/dist-snap/src/snapshots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2013-10-07 c919629
2+
freebsd-x86_64 c9af0c52bdcc1ffe2db4c9a3a1aaae66ff7fcc2c
3+
linux-i386 0245cb9e57c9b39f3441e9768256783ba76be6e7
4+
linux-x86_64 483d9bd109316e647a11d387653568d95e3581e6
5+
macos-i386 c12154816a8f5cd7b2c758250859cf6abf3eddbf
6+
macos-x86_64 9d46c31618a3bbd6ddffa598f1350e16c620621b
7+
winnt-i386 b111d291a15ff7f02aba9c59bb81ae7a3cd86628
8+
19
S 2013-10-04 8bb55db
210
freebsd-x86_64 8b68b99033e68f5d98e3e3d077de9d2e085be1ba
311
linux-i386 10bc0069efdca378155640963d70d3a08a7248dc

branches/dist-snap/src/test/compile-fail/issue-2354-1.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

branches/dist-snap/src/test/compile-fail/issue-2354.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn foo() { //~ NOTE Did you mean to close this delimiter?
11+
// xfail-test
12+
/*
13+
Ideally, the error about the missing close brace in foo would be reported
14+
near the corresponding open brace. But currently it's reported at the end.
15+
xfailed for now (see Issue #2354)
16+
*/
17+
fn foo() { //~ ERROR this open brace is not closed
1218
match Some(x) {
1319
Some(y) { fail!(); }
1420
None { fail!(); }
@@ -19,4 +25,4 @@ fn bar() {
1925
while (i < 1000) {}
2026
}
2127

22-
fn main() {} //~ ERROR This file contains an un-closed delimiter
28+
fn main() {}

0 commit comments

Comments
 (0)