Skip to content

Commit 4dbf58c

Browse files
committed
---
yaml --- r: 145880 b: refs/heads/try2 c: afa42a0 h: refs/heads/master v: v3
1 parent 610ab64 commit 4dbf58c

Some content is hidden

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

58 files changed

+2243
-1607
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: a9dddbacde8e204ee7485bc11b5c23a06d57430d
8+
refs/heads/try2: afa42a02379637fb621ffb2f6618344aaabadfcb
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rustpkg.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ and builds it in any workspace(s) where it finds one.
137137
Supposing such packages are found in workspaces X, Y, and Z,
138138
the command leaves behind files in `X`'s, `Y`'s, and `Z`'s `build` directories,
139139
but not in their `lib` or `bin` directories.
140+
(The exception is when rustpkg fetches a package `foo`'s sources from a remote repository.
141+
In that case, it stores both the sources *and* the build artifacts for `foo`
142+
in the workspace that `foo` will install to (see ##install below)).
140143

141144
## clean
142145

@@ -148,7 +151,11 @@ but not in their `lib` or `bin` directories.
148151
If `RUST_PATH` is declared as an environment variable, then rustpkg installs the
149152
libraries and executables into the `lib` and `bin` subdirectories
150153
of the first entry in `RUST_PATH`.
151-
Otherwise, it installs them into `foo`'s `lib` and `bin` directories.
154+
Otherwise, if the current working directory CWD is a workspace,
155+
it installs them into CWD's `lib` and `bin` subdirectories.
156+
Otherwise, if the current working directory is CWD,
157+
it installs them into the .rust/lib and .rust/bin subdirectories of CWD
158+
(creating them if necessary).
152159

153160
## test
154161

branches/try2/doc/tutorial-ffi.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ the true length after compression for setting the length.
135135
~~~~ {.xfail-test}
136136
pub fn compress(src: &[u8]) -> ~[u8] {
137137
#[fixed_stack_segment]; #[inline(never)];
138-
138+
139139
unsafe {
140140
let srclen = src.len() as size_t;
141141
let psrc = vec::raw::to_ptr(src);
@@ -157,7 +157,7 @@ format and `snappy_uncompressed_length` will retrieve the exact buffer size requ
157157
~~~~ {.xfail-test}
158158
pub fn uncompress(src: &[u8]) -> Option<~[u8]> {
159159
#[fixed_stack_segment]; #[inline(never)];
160-
160+
161161
unsafe {
162162
let srclen = src.len() as size_t;
163163
let psrc = vec::raw::to_ptr(src);
@@ -236,7 +236,7 @@ use std::libc::size_t;
236236
unsafe fn snappy_max_compressed_length(source_length: size_t) -> size_t {
237237
#[fixed_stack_segment]; #[inline(never)];
238238
return snappy_max_compressed_length(source_length);
239-
239+
240240
#[link_args = "-lsnappy"]
241241
extern {
242242
fn snappy_max_compressed_length(source_length: size_t) -> size_t;
@@ -259,9 +259,9 @@ check that one of the following conditions holds:
259259
2. The call occurs inside of an `extern fn`;
260260
3. The call occurs within a stack closure created by some other
261261
safe fn.
262-
262+
263263
All of these conditions ensure that you are running on a large stack
264-
segmented. However, they are sometimes too strict. If your application
264+
segment. However, they are sometimes too strict. If your application
265265
will be making many calls into C, it is often beneficial to promote
266266
the `#[fixed_stack_segment]` attribute higher up the call chain. For
267267
example, the Rust compiler actually labels main itself as requiring a
@@ -298,7 +298,7 @@ impl<T: Send> Unique<T> {
298298
pub fn new(value: T) -> Unique<T> {
299299
#[fixed_stack_segment];
300300
#[inline(never)];
301-
301+
302302
unsafe {
303303
let ptr = malloc(std::sys::size_of::<T>() as size_t) as *mut T;
304304
assert!(!ptr::is_null(ptr));
@@ -324,7 +324,7 @@ impl<T: Send> Drop for Unique<T> {
324324
fn drop(&mut self) {
325325
#[fixed_stack_segment];
326326
#[inline(never)];
327-
327+
328328
unsafe {
329329
let x = intrinsics::init(); // dummy value to swap in
330330
// moving the object out is needed to call the destructor

branches/try2/src/compiletest/errors.rs

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

11-
use std::io;
12-
1311
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
1412

1513
// Load any test directives embedded in the file
1614
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+
1719
let mut error_patterns = ~[];
18-
let rdr = io::file_reader(testfile).unwrap();
20+
let mut rdr = BufferedReader::new(testfile.open_reader(Open).unwrap());
1921
let mut line_num = 1u;
20-
while !rdr.eof() {
21-
let ln = rdr.read_line();
22+
loop {
23+
let ln = match rdr.read_line() {
24+
Some(ln) => ln, None => break,
25+
};
2226
error_patterns.push_all_move(parse_expected(line_num, ln));
2327
line_num += 1u;
2428
}
2529
return error_patterns;
2630
}
2731

2832
fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
33+
let line = line.trim();
2934
let error_tag = ~"//~";
3035
let mut idx;
3136
match line.find_str(error_tag) {

branches/try2/src/compiletest/header.rs

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

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

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();
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+
};
111115

112116
// Assume that any directives will be found before the first
113117
// module or function. This doesn't seem to be an optimization
114118
// with a warm page cache. Maybe with a cold one.
115119
if ln.starts_with("fn") || ln.starts_with("mod") {
116120
return true;
117-
} else { if !(it(ln)) { return false; } }
121+
} else { if !(it(ln.trim())) { return false; } }
118122
}
119123
return true;
120124
}

branches/try2/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_str(*input);
60+
proc.input().write(input.as_bytes());
6161
}
6262
let output = proc.finish_with_output();
6363

branches/try2/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)