Skip to content

Commit 401f7d9

Browse files
committed
---
yaml --- r: 65239 b: refs/heads/master c: dc970c1 h: refs/heads/master i: 65237: 8773815 65235: da45b6e 65231: b43eaf7 v: v3
1 parent c0d4b0d commit 401f7d9

File tree

19 files changed

+546
-567
lines changed

19 files changed

+546
-567
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1965d7295775b93d56f6daea96a6d2f6e8f242da
2+
refs/heads/master: dc970c13f476ef086066a47829185ac83645c61f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/cast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//! Unsafe casting functions
1212
1313
use sys;
14-
use unstable;
1514
use unstable::intrinsics;
1615

1716
/// Casts the value at `src` to U. The two types must have the same length.

trunk/src/libstd/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ mod tests {
488488
assert!(f == i && f == v);
489489

490490
buf += ~[t as u8];
491-
stream_inc.input(~[t as u8]);
491+
stream_inc.input([t as u8]);
492492

493493
t += 1;
494494
}

trunk/src/libstd/io.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ mod tests {
18391839
{
18401840
let out: @io::Writer =
18411841
result::get(
1842-
&io::file_writer(tmpfile, ~[io::Create, io::Truncate]));
1842+
&io::file_writer(tmpfile, [io::Create, io::Truncate]));
18431843
out.write_str(frood);
18441844
}
18451845
let inp: @io::Reader = result::get(&io::file_reader(tmpfile));
@@ -1850,31 +1850,31 @@ mod tests {
18501850

18511851
#[test]
18521852
fn test_readchars_empty() {
1853-
do io::with_str_reader(~"") |inp| {
1853+
do io::with_str_reader("") |inp| {
18541854
let res : ~[char] = inp.read_chars(128);
18551855
assert_eq!(res.len(), 0);
18561856
}
18571857
}
18581858

18591859
#[test]
18601860
fn test_read_line_utf8() {
1861-
do io::with_str_reader(~"生锈的汤匙切肉汤hello生锈的汤匙切肉汤") |inp| {
1861+
do io::with_str_reader("生锈的汤匙切肉汤hello生锈的汤匙切肉汤") |inp| {
18621862
let line = inp.read_line();
18631863
assert_eq!(line, ~"生锈的汤匙切肉汤hello生锈的汤匙切肉汤");
18641864
}
18651865
}
18661866
18671867
#[test]
18681868
fn test_read_lines() {
1869-
do io::with_str_reader(~"a\nb\nc\n") |inp| {
1869+
do io::with_str_reader("a\nb\nc\n") |inp| {
18701870
assert_eq!(inp.read_lines(), ~[~"a", ~"b", ~"c"]);
18711871
}
18721872
1873-
do io::with_str_reader(~"a\nb\nc") |inp| {
1873+
do io::with_str_reader("a\nb\nc") |inp| {
18741874
assert_eq!(inp.read_lines(), ~[~"a", ~"b", ~"c"]);
18751875
}
18761876
1877-
do io::with_str_reader(~"") |inp| {
1877+
do io::with_str_reader("") |inp| {
18781878
assert!(inp.read_lines().is_empty());
18791879
}
18801880
}
@@ -1909,15 +1909,15 @@ mod tests {
19091909
19101910
#[test]
19111911
fn test_readchar() {
1912-
do io::with_str_reader(~"") |inp| {
1912+
do io::with_str_reader("") |inp| {
19131913
let res : char = inp.read_char();
19141914
assert_eq!(res as int, 29983);
19151915
}
19161916
}
19171917
19181918
#[test]
19191919
fn test_readchar_empty() {
1920-
do io::with_str_reader(~"") |inp| {
1920+
do io::with_str_reader("") |inp| {
19211921
let res : char = inp.read_char();
19221922
assert_eq!(res as int, -1);
19231923
}
@@ -1966,7 +1966,7 @@ mod tests {
19661966
19671967
#[test]
19681968
fn file_writer_bad_name() {
1969-
match io::file_writer(&Path("?/?"), ~[]) {
1969+
match io::file_writer(&Path("?/?"), []) {
19701970
result::Err(copy e) => {
19711971
assert!(str::starts_with(e, "error opening"));
19721972
}
@@ -1987,15 +1987,15 @@ mod tests {
19871987
#[test]
19881988
fn bytes_buffer_overwrite() {
19891989
let wr = BytesWriter();
1990-
wr.write(~[0u8, 1u8, 2u8, 3u8]);
1990+
wr.write([0u8, 1u8, 2u8, 3u8]);
19911991
assert!(*wr.bytes == ~[0u8, 1u8, 2u8, 3u8]);
19921992
wr.seek(-2, SeekCur);
1993-
wr.write(~[4u8, 5u8, 6u8, 7u8]);
1993+
wr.write([4u8, 5u8, 6u8, 7u8]);
19941994
assert!(*wr.bytes == ~[0u8, 1u8, 4u8, 5u8, 6u8, 7u8]);
19951995
wr.seek(-2, SeekEnd);
1996-
wr.write(~[8u8]);
1996+
wr.write([8u8]);
19971997
wr.seek(1, SeekSet);
1998-
wr.write(~[9u8]);
1998+
wr.write([9u8]);
19991999
assert!(*wr.bytes == ~[0u8, 9u8, 4u8, 5u8, 8u8, 7u8]);
20002000
}
20012001
@@ -2085,7 +2085,7 @@ mod tests {
20852085
}
20862086
}
20872087
2088-
#[test]
2088+
#[test]
20892089
fn test_read_write_f32() {
20902090
let path = Path("tmp/lib-io-test-read-write-f32.tmp");
20912091
let f:f32 = 8.1250;

trunk/src/libstd/num/f32.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ impl num::FromStrRadix for f32 {
951951
mod tests {
952952
use f32::*;
953953
use num::*;
954-
use super::*;
955954
use prelude::*;
956955

957956
#[test]

trunk/src/libstd/num/f64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,6 @@ impl num::FromStrRadix for f64 {
993993
mod tests {
994994
use f64::*;
995995
use num::*;
996-
use super::*;
997996
use prelude::*;
998997

999998
#[test]

trunk/src/libstd/num/float.rs

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,101 +1251,101 @@ mod tests {
12511251
12521252
#[test]
12531253
pub fn test_from_str() {
1254-
assert_eq!(from_str(~"3"), Some(3.));
1255-
assert_eq!(from_str(~"3.14"), Some(3.14));
1256-
assert_eq!(from_str(~"+3.14"), Some(3.14));
1257-
assert_eq!(from_str(~"-3.14"), Some(-3.14));
1258-
assert_eq!(from_str(~"2.5E10"), Some(25000000000.));
1259-
assert_eq!(from_str(~"2.5e10"), Some(25000000000.));
1260-
assert_eq!(from_str(~"25000000000.E-10"), Some(2.5));
1261-
assert_eq!(from_str(~"."), Some(0.));
1262-
assert_eq!(from_str(~".e1"), Some(0.));
1263-
assert_eq!(from_str(~".e-1"), Some(0.));
1264-
assert_eq!(from_str(~"5."), Some(5.));
1265-
assert_eq!(from_str(~".5"), Some(0.5));
1266-
assert_eq!(from_str(~"0.5"), Some(0.5));
1267-
assert_eq!(from_str(~"-.5"), Some(-0.5));
1268-
assert_eq!(from_str(~"-5"), Some(-5.));
1269-
assert_eq!(from_str(~"inf"), Some(infinity));
1270-
assert_eq!(from_str(~"+inf"), Some(infinity));
1271-
assert_eq!(from_str(~"-inf"), Some(neg_infinity));
1254+
assert_eq!(from_str("3"), Some(3.));
1255+
assert_eq!(from_str("3.14"), Some(3.14));
1256+
assert_eq!(from_str("+3.14"), Some(3.14));
1257+
assert_eq!(from_str("-3.14"), Some(-3.14));
1258+
assert_eq!(from_str("2.5E10"), Some(25000000000.));
1259+
assert_eq!(from_str("2.5e10"), Some(25000000000.));
1260+
assert_eq!(from_str("25000000000.E-10"), Some(2.5));
1261+
assert_eq!(from_str("."), Some(0.));
1262+
assert_eq!(from_str(".e1"), Some(0.));
1263+
assert_eq!(from_str(".e-1"), Some(0.));
1264+
assert_eq!(from_str("5."), Some(5.));
1265+
assert_eq!(from_str(".5"), Some(0.5));
1266+
assert_eq!(from_str("0.5"), Some(0.5));
1267+
assert_eq!(from_str("-.5"), Some(-0.5));
1268+
assert_eq!(from_str("-5"), Some(-5.));
1269+
assert_eq!(from_str("inf"), Some(infinity));
1270+
assert_eq!(from_str("+inf"), Some(infinity));
1271+
assert_eq!(from_str("-inf"), Some(neg_infinity));
12721272
// note: NaN != NaN, hence this slightly complex test
1273-
match from_str(~"NaN") {
1273+
match from_str("NaN") {
12741274
Some(f) => assert!(f.is_NaN()),
12751275
None => fail!()
12761276
}
12771277
// note: -0 == 0, hence these slightly more complex tests
1278-
match from_str(~"-0") {
1278+
match from_str("-0") {
12791279
Some(v) if v.is_zero() => assert!(v.is_negative()),
12801280
_ => fail!()
12811281
}
1282-
match from_str(~"0") {
1282+
match from_str("0") {
12831283
Some(v) if v.is_zero() => assert!(v.is_positive()),
12841284
_ => fail!()
12851285
}
12861286
1287-
assert!(from_str(~"").is_none());
1288-
assert!(from_str(~"x").is_none());
1289-
assert!(from_str(~" ").is_none());
1290-
assert!(from_str(~" ").is_none());
1291-
assert!(from_str(~"e").is_none());
1292-
assert!(from_str(~"E").is_none());
1293-
assert!(from_str(~"E1").is_none());
1294-
assert!(from_str(~"1e1e1").is_none());
1295-
assert!(from_str(~"1e1.1").is_none());
1296-
assert!(from_str(~"1e1-1").is_none());
1287+
assert!(from_str("").is_none());
1288+
assert!(from_str("x").is_none());
1289+
assert!(from_str(" ").is_none());
1290+
assert!(from_str(" ").is_none());
1291+
assert!(from_str("e").is_none());
1292+
assert!(from_str("E").is_none());
1293+
assert!(from_str("E1").is_none());
1294+
assert!(from_str("1e1e1").is_none());
1295+
assert!(from_str("1e1.1").is_none());
1296+
assert!(from_str("1e1-1").is_none());
12971297
}
12981298
12991299
#[test]
13001300
pub fn test_from_str_hex() {
1301-
assert_eq!(from_str_hex(~"a4"), Some(164.));
1302-
assert_eq!(from_str_hex(~"a4.fe"), Some(164.9921875));
1303-
assert_eq!(from_str_hex(~"-a4.fe"), Some(-164.9921875));
1304-
assert_eq!(from_str_hex(~"+a4.fe"), Some(164.9921875));
1305-
assert_eq!(from_str_hex(~"ff0P4"), Some(0xff00 as float));
1306-
assert_eq!(from_str_hex(~"ff0p4"), Some(0xff00 as float));
1307-
assert_eq!(from_str_hex(~"ff0p-4"), Some(0xff as float));
1308-
assert_eq!(from_str_hex(~"."), Some(0.));
1309-
assert_eq!(from_str_hex(~".p1"), Some(0.));
1310-
assert_eq!(from_str_hex(~".p-1"), Some(0.));
1311-
assert_eq!(from_str_hex(~"f."), Some(15.));
1312-
assert_eq!(from_str_hex(~".f"), Some(0.9375));
1313-
assert_eq!(from_str_hex(~"0.f"), Some(0.9375));
1314-
assert_eq!(from_str_hex(~"-.f"), Some(-0.9375));
1315-
assert_eq!(from_str_hex(~"-f"), Some(-15.));
1316-
assert_eq!(from_str_hex(~"inf"), Some(infinity));
1317-
assert_eq!(from_str_hex(~"+inf"), Some(infinity));
1318-
assert_eq!(from_str_hex(~"-inf"), Some(neg_infinity));
1301+
assert_eq!(from_str_hex("a4"), Some(164.));
1302+
assert_eq!(from_str_hex("a4.fe"), Some(164.9921875));
1303+
assert_eq!(from_str_hex("-a4.fe"), Some(-164.9921875));
1304+
assert_eq!(from_str_hex("+a4.fe"), Some(164.9921875));
1305+
assert_eq!(from_str_hex("ff0P4"), Some(0xff00 as float));
1306+
assert_eq!(from_str_hex("ff0p4"), Some(0xff00 as float));
1307+
assert_eq!(from_str_hex("ff0p-4"), Some(0xff as float));
1308+
assert_eq!(from_str_hex("."), Some(0.));
1309+
assert_eq!(from_str_hex(".p1"), Some(0.));
1310+
assert_eq!(from_str_hex(".p-1"), Some(0.));
1311+
assert_eq!(from_str_hex("f."), Some(15.));
1312+
assert_eq!(from_str_hex(".f"), Some(0.9375));
1313+
assert_eq!(from_str_hex("0.f"), Some(0.9375));
1314+
assert_eq!(from_str_hex("-.f"), Some(-0.9375));
1315+
assert_eq!(from_str_hex("-f"), Some(-15.));
1316+
assert_eq!(from_str_hex("inf"), Some(infinity));
1317+
assert_eq!(from_str_hex("+inf"), Some(infinity));
1318+
assert_eq!(from_str_hex("-inf"), Some(neg_infinity));
13191319
// note: NaN != NaN, hence this slightly complex test
1320-
match from_str_hex(~"NaN") {
1320+
match from_str_hex("NaN") {
13211321
Some(f) => assert!(f.is_NaN()),
13221322
None => fail!()
13231323
}
13241324
// note: -0 == 0, hence these slightly more complex tests
1325-
match from_str_hex(~"-0") {
1325+
match from_str_hex("-0") {
13261326
Some(v) if v.is_zero() => assert!(v.is_negative()),
13271327
_ => fail!()
13281328
}
1329-
match from_str_hex(~"0") {
1329+
match from_str_hex("0") {
13301330
Some(v) if v.is_zero() => assert!(v.is_positive()),
13311331
_ => fail!()
13321332
}
1333-
assert_eq!(from_str_hex(~"e"), Some(14.));
1334-
assert_eq!(from_str_hex(~"E"), Some(14.));
1335-
assert_eq!(from_str_hex(~"E1"), Some(225.));
1336-
assert_eq!(from_str_hex(~"1e1e1"), Some(123361.));
1337-
assert_eq!(from_str_hex(~"1e1.1"), Some(481.0625));
1338-
1339-
assert!(from_str_hex(~"").is_none());
1340-
assert!(from_str_hex(~"x").is_none());
1341-
assert!(from_str_hex(~" ").is_none());
1342-
assert!(from_str_hex(~" ").is_none());
1343-
assert!(from_str_hex(~"p").is_none());
1344-
assert!(from_str_hex(~"P").is_none());
1345-
assert!(from_str_hex(~"P1").is_none());
1346-
assert!(from_str_hex(~"1p1p1").is_none());
1347-
assert!(from_str_hex(~"1p1.1").is_none());
1348-
assert!(from_str_hex(~"1p1-1").is_none());
1333+
assert_eq!(from_str_hex("e"), Some(14.));
1334+
assert_eq!(from_str_hex("E"), Some(14.));
1335+
assert_eq!(from_str_hex("E1"), Some(225.));
1336+
assert_eq!(from_str_hex("1e1e1"), Some(123361.));
1337+
assert_eq!(from_str_hex("1e1.1"), Some(481.0625));
1338+
1339+
assert!(from_str_hex("").is_none());
1340+
assert!(from_str_hex("x").is_none());
1341+
assert!(from_str_hex(" ").is_none());
1342+
assert!(from_str_hex(" ").is_none());
1343+
assert!(from_str_hex("p").is_none());
1344+
assert!(from_str_hex("P").is_none());
1345+
assert!(from_str_hex("P1").is_none());
1346+
assert!(from_str_hex("1p1p1").is_none());
1347+
assert!(from_str_hex("1p1.1").is_none());
1348+
assert!(from_str_hex("1p1-1").is_none());
13491349
}
13501350
13511351
#[test]
@@ -1375,8 +1375,8 @@ mod tests {
13751375
13761376
#[test]
13771377
pub fn test_from_str_radix() {
1378-
assert_eq!(from_str_radix(~"10", 36u), Some(36.));
1379-
assert_eq!(from_str_radix(~"1000.001", 2u), Some(8.125));
1378+
assert_eq!(from_str_radix("10", 36u), Some(36.));
1379+
assert_eq!(from_str_radix("1000.001", 2u), Some(8.125));
13801380
}
13811381
13821382
#[test]

0 commit comments

Comments
 (0)