Skip to content

Commit 958c85c

Browse files
committed
---
yaml --- r: 44941 b: refs/heads/master c: 40e733a h: refs/heads/master i: 44939: 773db88 v: v3
1 parent 02a4192 commit 958c85c

File tree

221 files changed

+744
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+744
-170
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: cb4ab76e4a17e0efc6b506af15fd1df654c043ff
2+
refs/heads/master: 40e733a1509044a5dacc0012426879a664c7a146
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/compiletest/common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
use core::prelude::*;
1212

13+
use cmp;
14+
1315
#[deriving_eq]
1416
pub enum mode {
1517
mode_compile_fail,

trunk/src/compiletest/compiletest.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub mod errors;
3232
use std::getopts;
3333
use std::test;
3434

35+
use core::{result, either};
3536
use core::result::{Ok, Err};
3637

3738
use common::config;

trunk/src/compiletest/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
use core::prelude::*;
1212

13+
use common::config;
14+
1315
use core::io;
1416
use core::io::ReaderUtil;
1517
use core::str;

trunk/src/compiletest/procsrv.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ use core::prelude::*;
1313
use core::io::{ReaderUtil, WriterUtil};
1414
use core::io;
1515
use core::libc::{c_int, pid_t};
16+
use core::libc;
1617
use core::os;
18+
use core::pipes;
1719
use core::run::spawn_process;
1820
use core::run;
1921
use core::str;
2022
use core::task;
23+
use core::vec;
2124

2225
#[cfg(target_os = "win32")]
2326
fn target_env(lib_path: ~str, prog: ~str) -> ~[(~str,~str)] {

trunk/src/compiletest/runtest.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010

1111
use core::prelude::*;
1212

13+
use common;
1314
use common::mode_run_pass;
1415
use common::mode_run_fail;
1516
use common::mode_compile_fail;
1617
use common::mode_pretty;
1718
use common::config;
1819
use errors;
20+
use header;
1921
use header::load_props;
2022
use header::TestProps;
2123
use procsrv;

trunk/src/compiletest/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010

1111
use core::prelude::*;
1212

13+
use common;
1314
use common::config;
1415

1516
use core::io;
1617
use core::os::getenv;
18+
use core::os;
1719

1820
pub fn make_new_path(path: ~str) -> ~str {
1921

trunk/src/libcore/bool.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
//! Boolean logic
1313
14+
use bool;
15+
use cmp;
16+
use cmp::Eq;
1417
use option::{None, Option, Some};
15-
#[cfg(notest)] use cmp;
1618

1719
/// Negation / inverse
1820
pub pure fn not(v: bool) -> bool { !v }
@@ -80,7 +82,7 @@ impl cmp::Eq for bool {
8082
#[test]
8183
pub fn test_bool_from_str() {
8284
do all_values |v| {
83-
assert Some(v) == from_str(to_str(v))
85+
assert Some(v) == from_str(bool::to_str(v))
8486
}
8587
}
8688

trunk/src/libcore/char.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
//! Utilities for manipulating the char type
1212
13+
use char;
14+
use cmp::Eq;
1315
use option::{None, Option, Some};
1416
use str;
1517
use u32;
1618
use uint;
1719
use unicode;
1820

19-
#[cfg(notest)] use cmp::Eq;
20-
2121
/*
2222
Lu Uppercase_Letter an uppercase letter
2323
Ll Lowercase_Letter a lowercase letter
@@ -305,8 +305,8 @@ fn test_to_digit() {
305305

306306
#[test]
307307
fn test_is_ascii() {
308-
assert str::all(~"banana", is_ascii);
309-
assert ! str::all(~"ประเทศไทย中华Việt Nam", is_ascii);
308+
assert str::all(~"banana", char::is_ascii);
309+
assert ! str::all(~"ประเทศไทย中华Việt Nam", char::is_ascii);
310310
}
311311

312312
#[test]

trunk/src/libcore/dvec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Note that recursive use is not permitted.
2020
*/
2121

2222
use cast;
23+
use cast::reinterpret_cast;
2324
use prelude::*;
2425
use ptr::null;
2526
use vec;

trunk/src/libcore/either.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//! A type that represents one of two alternatives
1212
1313
use cmp::Eq;
14+
use cmp;
1415
use kinds::Copy;
1516
use result::Result;
1617
use result;

trunk/src/libcore/flate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ Simple compression
1717
use libc;
1818
use libc::{c_void, size_t, c_int};
1919
use ptr;
20+
use rand;
2021
use vec;
2122

22-
#[cfg(test)] use rand;
23-
2423
extern mod rustrt {
2524
unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
2625
src_buf_len: size_t,

trunk/src/libcore/hash.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
use io;
2323
use io::{Writer, WriterUtil};
24+
use os;
2425
use to_bytes::IterBytes;
2526
use uint;
2627
use vec;

trunk/src/libcore/hashmap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ pub mod linear {
1919
use iter::BaseIter;
2020
use hash::Hash;
2121
use iter;
22+
use kinds::Copy;
2223
use option::{None, Option, Some};
24+
use option;
2325
use rand;
26+
use to_bytes::IterBytes;
2427
use uint;
2528
use vec;
2629

trunk/src/libcore/io.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ Basic input/output
1616

1717
use result::Result;
1818

19+
use cmp::Eq;
1920
use dvec::DVec;
2021
use int;
2122
use libc;
2223
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
2324
use libc::consts::os::posix88::*;
25+
use libc::consts::os::extra::*;
26+
use option;
2427
use os;
2528
use prelude::*;
2629
use ptr;
@@ -75,6 +78,9 @@ pub trait ReaderUtil {
7578
/// Read len bytes into a new vec.
7679
fn read_bytes(&self, len: uint) -> ~[u8];
7780

81+
/// Read up until a specified character (which is not returned) or EOF.
82+
fn read_until(&self, c: char) -> ~str;
83+
7884
/// Read up until the first '\n' char (which is not returned), or EOF.
7985
fn read_line(&self) -> ~str;
8086

@@ -178,16 +184,22 @@ impl<T:Reader> ReaderUtil for T {
178184
bytes
179185
}
180186

181-
fn read_line(&self) -> ~str {
187+
fn read_until(&self, c: char) -> ~str {
182188
let mut bytes = ~[];
183189
loop {
184190
let ch = self.read_byte();
185-
if ch == -1 || ch == 10 { break; }
191+
if ch == -1 || ch == c as int {
192+
break;
193+
}
186194
bytes.push(ch as u8);
187195
}
188196
str::from_bytes(bytes)
189197
}
190198

199+
fn read_line(&self) -> ~str {
200+
self.read_until('\n')
201+
}
202+
191203
fn read_chars(&self, n: uint) -> ~[char] {
192204
// returns the (consumed offset, n_req), appends characters to &chars
193205
fn chars_from_bytes<T:Reader>(bytes: &~[u8], chars: &mut ~[char])
@@ -259,12 +271,7 @@ impl<T:Reader> ReaderUtil for T {
259271
}
260272

261273
fn read_c_str(&self) -> ~str {
262-
let mut bytes: ~[u8] = ~[];
263-
loop {
264-
let ch = self.read_byte();
265-
if ch < 1 { break; } else { bytes.push(ch as u8); }
266-
}
267-
str::from_bytes(bytes)
274+
self.read_until(0 as char)
268275
}
269276

270277
fn read_whole_stream(&self) -> ~[u8] {
@@ -712,9 +719,7 @@ pub fn mk_file_writer(path: &Path, flags: &[FileFlag])
712719
-> Result<Writer, ~str> {
713720

714721
#[cfg(windows)]
715-
fn wb() -> c_int {
716-
(O_WRONLY | libc::consts::os::extra::O_BINARY) as c_int
717-
}
722+
fn wb() -> c_int { (O_WRONLY | O_BINARY) as c_int }
718723

719724
#[cfg(unix)]
720725
fn wb() -> c_int { O_WRONLY as c_int }

trunk/src/libcore/iter-trait/dlist.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
mod inst {
12+
use cast;
13+
use dlist;
1214
use dlist::DList;
1315
use managed;
1416
use option::{Option, Some};

trunk/src/libcore/libc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,7 @@ pub mod funcs {
10071007

10081008
pub mod c95 {
10091009
use libc::types::common::c95::{FILE, c_void, fpos_t};
1010+
use libc::types::common::posix88::dirent_t;
10101011
use libc::types::os::arch::c95::{c_char, c_double, c_int, c_long};
10111012
use libc::types::os::arch::c95::{c_uint, c_ulong, c_void, size_t};
10121013

trunk/src/libcore/logging.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
//! Logging
1212
13+
use cast::transmute;
14+
use io;
1315
use libc;
16+
use repr;
17+
use vec;
1418

1519
#[nolink]
1620
extern mod rustrt {
@@ -44,11 +48,6 @@ pub fn console_off() {
4448
#[cfg(notest)]
4549
#[lang="log_type"]
4650
pub fn log_type<T>(level: u32, object: &T) {
47-
use cast::transmute;
48-
use io;
49-
use repr;
50-
use vec;
51-
5251
let bytes = do io::with_bytes_writer |writer| {
5352
repr::write_repr(writer, object);
5453
};

trunk/src/libcore/managed.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010

1111
//! Operations on managed box types
1212
13+
use cast::transmute;
14+
use cmp::{Eq, Ord};
15+
use managed::raw::BoxRepr;
16+
use prelude::*;
1317
use ptr;
1418

15-
#[cfg(notest)] use cmp::{Eq, Ord};
1619

1720
pub mod raw {
1821

trunk/src/libcore/nil.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Functions for the unit type.
1414
1515
*/
1616

17-
#[cfg(notest)]
1817
use cmp::{Eq, Ord};
1918

2019
#[cfg(notest)]

trunk/src/libcore/num/f32.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@
1111
//! Operations and constants for `f32`
1212
1313
use cmath;
14+
use cmp;
1415
use libc::{c_float, c_int};
1516
use num::NumCast;
1617
use num::strconv;
1718
use num;
19+
use ops;
1820
use option::Option;
1921
use unstable::intrinsics::floorf32;
2022
use from_str;
2123
use to_str;
2224

23-
#[cfg(notest)] use cmp;
24-
#[cfg(notest)] use ops;
25-
2625
pub use cmath::c_float_targ_consts::*;
2726

2827
macro_rules! delegate(

trunk/src/libcore/num/f64.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
//! Operations and constants for `f64`
1212
1313
use cmath;
14+
use cmp;
1415
use libc::{c_double, c_int};
16+
use libc;
1517
use num::NumCast;
1618
use num::strconv;
1719
use num;
20+
use ops;
1821
use option::Option;
1922
use unstable::intrinsics::floorf64;
2023
use to_str;
2124
use from_str;
2225

23-
#[cfg(notest)] use cmp;
24-
#[cfg(notest)] use ops;
25-
2626
pub use cmath::c_double_targ_consts::*;
2727
pub use cmp::{min, max};
2828

trunk/src/libcore/num/float.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,21 @@
2020

2121
// PORT this must match in width according to architecture
2222

23+
use m_float = f64;
24+
25+
use cmp::{Eq, Ord};
26+
use cmp;
2327
use f64;
2428
use num::NumCast;
2529
use num::strconv;
2630
use num;
31+
use ops;
2732
use option::{None, Option, Some};
33+
use str;
34+
use uint;
2835
use to_str;
2936
use from_str;
3037

31-
#[cfg(notest)] use cmp::{Eq, Ord};
32-
#[cfg(notest)] use ops;
33-
3438
pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
3539
pub use f64::logarithm;
3640
pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};

0 commit comments

Comments
 (0)