Skip to content

Commit 1d248ce

Browse files
committed
---
yaml --- r: 146147 b: refs/heads/try2 c: e2428b7 h: refs/heads/master i: 146145: ecda146 146143: 94485fb v: v3
1 parent e6aefbc commit 1d248ce

31 files changed

+1032
-581
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 142672dca4314e9cfebf067d46c3b542c721cff6
8+
refs/heads/try2: e2428b791c5a4074ca712ab3b145ee05c2d67ead
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/base64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ mod test {
318318
use std::vec;
319319
320320
do 1000.times {
321-
let times = task_rng().gen_integer_range(1u, 100);
321+
let times = task_rng().gen_range(1u, 100);
322322
let v = vec::from_fn(times, |_| random::<u8>());
323323
assert_eq!(v.to_base64(STANDARD).from_base64().unwrap(), v);
324324
}

branches/try2/src/libextra/crypto/cryptoutil.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ pub mod test {
365365
digest.reset();
366366

367367
while count < total_size {
368-
let next: uint = rng.gen_integer_range(0, 2 * blocksize + 1);
368+
let next: uint = rng.gen_range(0, 2 * blocksize + 1);
369369
let remaining = total_size - count;
370370
let size = if next > remaining { remaining } else { next };
371371
digest.input(buffer.slice_to(size));

branches/try2/src/libextra/flate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ mod tests {
113113
let mut r = rand::rng();
114114
let mut words = ~[];
115115
do 20.times {
116-
let range = r.gen_integer_range(1u, 10);
116+
let range = r.gen_range(1u, 10);
117117
words.push(r.gen_vec::<u8>(range));
118118
}
119119
do 20.times {

branches/try2/src/libextra/sort.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,8 @@ mod big_tests {
10691069
isSorted(arr);
10701070

10711071
do 3.times {
1072-
let i1 = rng.gen_integer_range(0u, n);
1073-
let i2 = rng.gen_integer_range(0u, n);
1072+
let i1 = rng.gen_range(0u, n);
1073+
let i2 = rng.gen_range(0u, n);
10741074
arr.swap(i1, i2);
10751075
}
10761076
tim_sort(arr); // 3sort
@@ -1088,7 +1088,7 @@ mod big_tests {
10881088
isSorted(arr);
10891089

10901090
do (n/100).times {
1091-
let idx = rng.gen_integer_range(0u, n);
1091+
let idx = rng.gen_range(0u, n);
10921092
arr[idx] = rng.gen();
10931093
}
10941094
tim_sort(arr);
@@ -1141,8 +1141,8 @@ mod big_tests {
11411141
isSorted(arr);
11421142

11431143
do 3.times {
1144-
let i1 = rng.gen_integer_range(0u, n);
1145-
let i2 = rng.gen_integer_range(0u, n);
1144+
let i1 = rng.gen_range(0u, n);
1145+
let i2 = rng.gen_range(0u, n);
11461146
arr.swap(i1, i2);
11471147
}
11481148
tim_sort(arr); // 3sort
@@ -1160,7 +1160,7 @@ mod big_tests {
11601160
isSorted(arr);
11611161

11621162
do (n/100).times {
1163-
let idx = rng.gen_integer_range(0u, n);
1163+
let idx = rng.gen_range(0u, n);
11641164
arr[idx] = @rng.gen();
11651165
}
11661166
tim_sort(arr);

branches/try2/src/libextra/time.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub mod rustrt {
3434
3535

3636
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
37-
pub struct Timespec { priv sec: i64, priv nsec: i32 }
37+
pub struct Timespec { sec: i64, nsec: i32 }
3838
/*
3939
* Timespec assumes that pre-epoch Timespecs have negative sec and positive
4040
* nsec fields. Darwin's and Linux's struct timespec functions handle pre-
@@ -106,18 +106,18 @@ pub fn tzset() {
106106

107107
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
108108
pub struct Tm {
109-
priv tm_sec: i32, // seconds after the minute ~[0-60]
110-
priv tm_min: i32, // minutes after the hour ~[0-59]
111-
priv tm_hour: i32, // hours after midnight ~[0-23]
112-
priv tm_mday: i32, // days of the month ~[1-31]
113-
priv tm_mon: i32, // months since January ~[0-11]
114-
priv tm_year: i32, // years since 1900
115-
priv tm_wday: i32, // days since Sunday ~[0-6]
116-
priv tm_yday: i32, // days since January 1 ~[0-365]
117-
priv tm_isdst: i32, // Daylight Savings Time flag
118-
priv tm_gmtoff: i32, // offset from UTC in seconds
119-
priv tm_zone: ~str, // timezone abbreviation
120-
priv tm_nsec: i32, // nanoseconds
109+
tm_sec: i32, // seconds after the minute ~[0-60]
110+
tm_min: i32, // minutes after the hour ~[0-59]
111+
tm_hour: i32, // hours after midnight ~[0-23]
112+
tm_mday: i32, // days of the month ~[1-31]
113+
tm_mon: i32, // months since January ~[0-11]
114+
tm_year: i32, // years since 1900
115+
tm_wday: i32, // days since Sunday ~[0-6]
116+
tm_yday: i32, // days since January 1 ~[0-365]
117+
tm_isdst: i32, // Daylight Savings Time flag
118+
tm_gmtoff: i32, // offset from UTC in seconds
119+
tm_zone: ~str, // timezone abbreviation
120+
tm_nsec: i32, // nanoseconds
121121
}
122122

123123
pub fn empty_tm() -> Tm {

branches/try2/src/libextra/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ mod test_treemap {
10281028
}
10291029

10301030
do 30.times {
1031-
let r = rng.gen_integer_range(0, ctrl.len());
1031+
let r = rng.gen_range(0, ctrl.len());
10321032
let (key, _) = ctrl.remove(r);
10331033
assert!(map.remove(&key));
10341034
check_structure(&map);

branches/try2/src/librustpkg/conditions.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212

1313
pub use std::path::Path;
1414
pub use package_id::PkgId;
15-
pub use std::libc;
16-
pub use std::libc::stat;
15+
pub use std::rt::io::FileStat;
1716

1817
condition! {
1918
pub bad_path: (Path, ~str) -> Path;
2019
}
2120

2221
condition! {
23-
pub bad_stat: (Path, ~str) -> stat;
22+
pub bad_stat: (Path, ~str) -> FileStat;
2423
}
2524

2625
condition! {

branches/try2/src/librustpkg/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -625,7 +625,7 @@ fn debug_flags() -> ~[~str] { ~[] }
625625
/// Returns the last-modified date as an Option
626626
pub fn datestamp(p: &Path) -> Option<libc::time_t> {
627627
debug!("Scrutinizing datestamp for {} - does it exist? {:?}", p.display(), os::path_exists(p));
628-
let out = p.stat().map(|stat| stat.st_mtime);
628+
let out = p.stat().map(|stat| stat.modified);
629629
debug!("Date = {:?}", out);
630630
out.map(|t| { t as libc::time_t })
631631
}

branches/try2/src/librustpkg/workcache_support.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ pub fn digest_file_with_date(path: &Path) -> ~str {
1818
use conditions::bad_path::cond;
1919
use cond1 = conditions::bad_stat::cond;
2020

21-
let mut sha = ~Sha1::new();
2221
let s = io::read_whole_file_str(path);
2322
match s {
2423
Ok(s) => {
25-
(*sha).input_str(s);
24+
let mut sha = Sha1::new();
25+
sha.input_str(s);
2626
let st = match path.stat() {
2727
Some(st) => st,
2828
None => cond1.raise((path.clone(), format!("Couldn't get file access time")))
2929
};
30-
(*sha).input_str(st.st_mtime.to_str());
31-
(*sha).result_str()
30+
sha.input_str(st.modified.to_str());
31+
sha.result_str()
3232
}
3333
Err(e) => {
3434
let path = cond.raise((path.clone(), format!("Couldn't read file: {}", e)));
@@ -43,13 +43,13 @@ pub fn digest_file_with_date(path: &Path) -> ~str {
4343
pub fn digest_only_date(path: &Path) -> ~str {
4444
use cond = conditions::bad_stat::cond;
4545

46-
let mut sha = ~Sha1::new();
46+
let mut sha = Sha1::new();
4747
let st = match path.stat() {
4848
Some(st) => st,
4949
None => cond.raise((path.clone(), format!("Couldn't get file access time")))
5050
};
51-
(*sha).input_str(st.st_mtime.to_str());
52-
(*sha).result_str()
51+
sha.input_str(st.modified.to_str());
52+
sha.result_str()
5353
}
5454

5555
/// Adds multiple discovered outputs

0 commit comments

Comments
 (0)