Skip to content

Commit 4e25b08

Browse files
committed
---
yaml --- r: 83838 b: refs/heads/try c: caf7b67 h: refs/heads/master v: v3
1 parent 41ea326 commit 4e25b08

Some content is hidden

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

43 files changed

+1243
-1726
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 0ede2ea4e2e9384ac5bd614012d85ed213873dab
5+
refs/heads/try: caf7b678dd2f07918b47120aa73a1bca51d12da1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/errors.rs

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

11+
use std::io;
12+
1113
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
1214

1315
// Load any test directives embedded in the file
1416
pub fn load_errors(testfile: &Path) -> ~[ExpectedError] {
15-
use std::rt::io::Open;
16-
use std::rt::io::file::FileInfo;
17-
use std::rt::io::buffered::BufferedReader;
18-
1917
let mut error_patterns = ~[];
20-
let mut rdr = BufferedReader::new(testfile.open_reader(Open).unwrap());
18+
let rdr = io::file_reader(testfile).unwrap();
2119
let mut line_num = 1u;
22-
loop {
23-
let ln = match rdr.read_line() {
24-
Some(ln) => ln, None => break,
25-
};
20+
while !rdr.eof() {
21+
let ln = rdr.read_line();
2622
error_patterns.push_all_move(parse_expected(line_num, ln));
2723
line_num += 1u;
2824
}
2925
return error_patterns;
3026
}
3127

3228
fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
33-
let line = line.trim();
3429
let error_tag = ~"//~";
3530
let mut idx;
3631
match line.find_str(error_tag) {

branches/try/src/compiletest/header.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use common::config;
1212
use common;
1313
use util;
1414

15+
use std::io;
16+
1517
pub struct TestProps {
1618
// Lines that should be expected, in order, on standard out
1719
error_patterns: ~[~str],
@@ -102,23 +104,17 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
102104
!val
103105
}
104106

105-
fn iter_header(testfile: &Path, it: &fn(&str) -> bool) -> bool {
106-
use std::rt::io::Open;
107-
use std::rt::io::file::FileInfo;
108-
use std::rt::io::buffered::BufferedReader;
109-
110-
let mut rdr = BufferedReader::new(testfile.open_reader(Open).unwrap());
111-
loop {
112-
let ln = match rdr.read_line() {
113-
Some(ln) => ln, None => break
114-
};
107+
fn iter_header(testfile: &Path, it: &fn(~str) -> bool) -> bool {
108+
let rdr = io::file_reader(testfile).unwrap();
109+
while !rdr.eof() {
110+
let ln = rdr.read_line();
115111

116112
// Assume that any directives will be found before the first
117113
// module or function. This doesn't seem to be an optimization
118114
// with a warm page cache. Maybe with a cold one.
119115
if ln.starts_with("fn") || ln.starts_with("mod") {
120116
return true;
121-
} else { if !(it(ln.trim())) { return false; } }
117+
} else { if !(it(ln)) { return false; } }
122118
}
123119
return true;
124120
}

branches/try/src/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn run(lib_path: &str,
5757
});
5858

5959
for input in input.iter() {
60-
proc.input().write(input.as_bytes());
60+
proc.input().write_str(*input);
6161
}
6262
let output = proc.finish_with_output();
6363

branches/try/src/libextra/base64.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ impl<'self> ToBase64 for &'self [u8] {
6464
*
6565
* ```rust
6666
* extern mod extra;
67-
* use extra::base64::{ToBase64, STANDARD};
67+
* use extra::base64::{ToBase64, standard};
6868
*
6969
* fn main () {
70-
* let str = [52,32].to_base64(STANDARD);
71-
* println!("base 64 output: {}", str);
70+
* let str = [52,32].to_base64(standard);
71+
* println!("{}", str);
7272
* }
7373
* ```
7474
*/
@@ -172,19 +172,16 @@ impl<'self> FromBase64 for &'self str {
172172
*
173173
* ```rust
174174
* extern mod extra;
175-
* use extra::base64::{ToBase64, FromBase64, STANDARD};
175+
* use extra::base64::{ToBase64, FromBase64, standard};
176176
* use std::str;
177177
*
178178
* fn main () {
179-
* let hello_str = bytes!("Hello, World").to_base64(STANDARD);
180-
* println!("base64 output: {}", hello_str);
181-
* let res = hello_str.from_base64();
182-
* if res.is_ok() {
183-
* let optBytes = str::from_utf8_opt(res.unwrap());
184-
* if optBytes.is_some() {
185-
* println!("decoded from base64: {}", optBytes.unwrap());
186-
* }
187-
* }
179+
* let hello_str = "Hello, World".to_base64(standard);
180+
* println!("{}", hello_str);
181+
* let bytes = hello_str.from_base64();
182+
* println!("{:?}", bytes);
183+
* let result_str = str::from_utf8(bytes);
184+
* println!("{}", result_str);
188185
* }
189186
* ```
190187
*/

branches/try/src/librustc/driver/driver.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,10 @@ pub fn phase_3_run_analysis_passes(sess: Session,
263263
method_map, ty_cx));
264264

265265
let maps = (external_exports, last_private_map);
266-
time(time_passes, "privacy checking", maps, |(a, b)|
267-
middle::privacy::check_crate(ty_cx, &method_map, &exp_map2,
268-
a, b, crate));
266+
let exported_items =
267+
time(time_passes, "privacy checking", maps, |(a, b)|
268+
middle::privacy::check_crate(ty_cx, &method_map, &exp_map2,
269+
a, b, crate));
269270

270271
time(time_passes, "effect checking", (), |_|
271272
middle::effect::check_crate(ty_cx, method_map, crate));
@@ -300,7 +301,8 @@ pub fn phase_3_run_analysis_passes(sess: Session,
300301

301302
let reachable_map =
302303
time(time_passes, "reachability checking", (), |_|
303-
reachable::find_reachable(ty_cx, method_map, crate));
304+
reachable::find_reachable(ty_cx, method_map, exp_map2,
305+
&exported_items));
304306

305307
time(time_passes, "lint checking", (), |_|
306308
lint::check_crate(ty_cx, crate));

0 commit comments

Comments
 (0)