Skip to content

Commit 490e3f0

Browse files
committed
---
yaml --- r: 145018 b: refs/heads/try2 c: a7215dd h: refs/heads/master v: v3
1 parent 6ed55a7 commit 490e3f0

File tree

19 files changed

+458
-560
lines changed

19 files changed

+458
-560
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: 7c8f503ac543e0ffe18986b8d6f8548df21cefa3
8+
refs/heads/try2: a7215dd284a1d2e15ecbe0c71b7c978fcba5e3ec
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/rt.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ RUNTIME_CXXS_$(1)_$(2) := \
7575
rt/rust_rng.cpp \
7676
rt/rust_upcall.cpp \
7777
rt/rust_uv.cpp \
78+
rt/rust_crate_map.cpp \
7879
rt/isaac/randport.cpp \
7980
rt/miniz.cpp \
8081
rt/memory_region.cpp \

branches/try2/src/libextra/fileinput.rs

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -417,23 +417,20 @@ mod test {
417417

418418
use super::{FileInput, make_path_option_vec, input_vec, input_vec_state};
419419

420-
use std::rt::io;
421-
use std::rt::io::Writer;
422-
use std::rt::io::file;
420+
use std::io;
423421
use std::uint;
424422
use std::vec;
425423

426424
fn make_file(path : &Path, contents: &[~str]) {
427-
let mut file = file::open(path, io::CreateOrTruncate, io::Write).unwrap();
425+
let file = io::file_writer(path, [io::Create, io::Truncate]).unwrap();
428426

429427
for str in contents.iter() {
430-
file.write(str.as_bytes());
431-
file.write(['\n' as u8]);
428+
file.write_str(*str);
429+
file.write_char('\n');
432430
}
433431
}
434432

435433
#[test]
436-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
437434
fn test_make_path_option_vec() {
438435
let strs = [~"some/path",
439436
~"some/other/path"];
@@ -448,7 +445,6 @@ mod test {
448445
}
449446
450447
#[test]
451-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
452448
fn test_fileinput_read_byte() {
453449
let filenames = make_path_option_vec(vec::from_fn(
454450
3,
@@ -479,7 +475,6 @@ mod test {
479475
}
480476
481477
#[test]
482-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
483478
fn test_fileinput_read() {
484479
let filenames = make_path_option_vec(vec::from_fn(
485480
3,
@@ -500,7 +495,6 @@ mod test {
500495
}
501496

502497
#[test]
503-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
504498
fn test_input_vec() {
505499
let mut all_lines = ~[];
506500
let filenames = make_path_option_vec(vec::from_fn(
@@ -524,7 +518,6 @@ mod test {
524518
}
525519

526520
#[test]
527-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
528521
fn test_input_vec_state() {
529522
let filenames = make_path_option_vec(vec::from_fn(
530523
3,
@@ -547,7 +540,6 @@ mod test {
547540
}
548541

549542
#[test]
550-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
551543
fn test_empty_files() {
552544
let filenames = make_path_option_vec(vec::from_fn(
553545
3,
@@ -572,21 +564,18 @@ mod test {
572564
}
573565
574566
#[test]
575-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
576567
fn test_no_trailing_newline() {
577568
let f1 =
578569
Some(Path("tmp/lib-fileinput-test-no-trailing-newline-1.tmp"));
579570
let f2 =
580571
Some(Path("tmp/lib-fileinput-test-no-trailing-newline-2.tmp"));
581572
582-
{
583-
let mut wr = file::open(f1.get_ref(), io::CreateOrTruncate,
584-
io::Write).unwrap();
585-
wr.write("1\n2".as_bytes());
586-
let mut wr = file::open(f2.get_ref(), io::CreateOrTruncate,
587-
io::Write).unwrap();
588-
wr.write("3\n4".as_bytes());
589-
}
573+
let wr = io::file_writer(f1.get_ref(),
574+
[io::Create, io::Truncate]).unwrap();
575+
wr.write_str("1\n2");
576+
let wr = io::file_writer(f2.get_ref(),
577+
[io::Create, io::Truncate]).unwrap();
578+
wr.write_str("3\n4");
590579
591580
let mut lines = ~[];
592581
do input_vec(~[f1, f2]) |line| {
@@ -598,7 +587,6 @@ mod test {
598587
599588
600589
#[test]
601-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
602590
fn test_next_file() {
603591
let filenames = make_path_option_vec(vec::from_fn(
604592
3,
@@ -630,7 +618,6 @@ mod test {
630618
631619
#[test]
632620
#[should_fail]
633-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
634621
fn test_input_vec_missing_file() {
635622
do input_vec(make_path_option_vec([~"this/file/doesnt/exist"], true)) |line| {
636623
println(line);

branches/try2/src/libextra/glob.rs

Lines changed: 0 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -516,194 +516,6 @@ mod test {
516516
use super::*;
517517
use tempfile;
518518
519-
#[test]
520-
fn test_relative_pattern() {
521-
522-
fn change_then_remove(p: &Path, f: &fn()) {
523-
do (|| {
524-
unstable::change_dir_locked(p, || f());
525-
}).finally {
526-
os::remove_dir_recursive(p);
527-
}
528-
}
529-
530-
fn mk_file(path: &str, directory: bool) {
531-
if directory {
532-
os::make_dir(&Path(path), 0xFFFF);
533-
} else {
534-
io::mk_file_writer(&Path(path), [io::Create]);
535-
}
536-
}
537-
538-
fn abs_path(path: &str) -> Path {
539-
os::getcwd().push_many(Path(path).components)
540-
}
541-
542-
fn glob_vec(pattern: &str) -> ~[Path] {
543-
glob(pattern).collect()
544-
}
545-
546-
let root = tempfile::mkdtemp(&os::tmpdir(), "glob-tests");
547-
let root = root.expect("Should have created a temp directory");
548-
549-
do change_then_remove(&root) {
550-
551-
mk_file("aaa", true);
552-
mk_file("aaa/apple", true);
553-
mk_file("aaa/orange", true);
554-
mk_file("aaa/tomato", true);
555-
mk_file("aaa/tomato/tomato.txt", false);
556-
mk_file("aaa/tomato/tomoto.txt", false);
557-
mk_file("bbb", true);
558-
mk_file("bbb/specials", true);
559-
mk_file("bbb/specials/!", false);
560-
561-
// windows does not allow `*` or `?` characters to exist in filenames
562-
if os::consts::FAMILY != os::consts::windows::FAMILY {
563-
mk_file("bbb/specials/*", false);
564-
mk_file("bbb/specials/?", false);
565-
}
566-
567-
mk_file("bbb/specials/[", false);
568-
mk_file("bbb/specials/]", false);
569-
mk_file("ccc", true);
570-
mk_file("xyz", true);
571-
mk_file("xyz/x", false);
572-
mk_file("xyz/y", false);
573-
mk_file("xyz/z", false);
574-
575-
assert_eq!(glob_vec(""), ~[]);
576-
assert_eq!(glob_vec("."), ~[]);
577-
assert_eq!(glob_vec(".."), ~[]);
578-
579-
assert_eq!(glob_vec("aaa"), ~[abs_path("aaa")]);
580-
assert_eq!(glob_vec("aaa/"), ~[abs_path("aaa")]);
581-
assert_eq!(glob_vec("a"), ~[]);
582-
assert_eq!(glob_vec("aa"), ~[]);
583-
assert_eq!(glob_vec("aaaa"), ~[]);
584-
585-
assert_eq!(glob_vec("aaa/apple"), ~[abs_path("aaa/apple")]);
586-
assert_eq!(glob_vec("aaa/apple/nope"), ~[]);
587-
588-
// windows should support both / and \ as directory separators
589-
if os::consts::FAMILY == os::consts::windows::FAMILY {
590-
assert_eq!(glob_vec("aaa\\apple"), ~[abs_path("aaa/apple")]);
591-
}
592-
593-
assert_eq!(glob_vec("???/"), ~[
594-
abs_path("aaa"),
595-
abs_path("bbb"),
596-
abs_path("ccc"),
597-
abs_path("xyz")]);
598-
599-
assert_eq!(glob_vec("aaa/tomato/tom?to.txt"), ~[
600-
abs_path("aaa/tomato/tomato.txt"),
601-
abs_path("aaa/tomato/tomoto.txt")]);
602-
603-
assert_eq!(glob_vec("xyz/?"), ~[
604-
abs_path("xyz/x"),
605-
abs_path("xyz/y"),
606-
abs_path("xyz/z")]);
607-
608-
assert_eq!(glob_vec("a*"), ~[abs_path("aaa")]);
609-
assert_eq!(glob_vec("*a*"), ~[abs_path("aaa")]);
610-
assert_eq!(glob_vec("a*a"), ~[abs_path("aaa")]);
611-
assert_eq!(glob_vec("aaa*"), ~[abs_path("aaa")]);
612-
assert_eq!(glob_vec("*aaa"), ~[abs_path("aaa")]);
613-
assert_eq!(glob_vec("*aaa*"), ~[abs_path("aaa")]);
614-
assert_eq!(glob_vec("*a*a*a*"), ~[abs_path("aaa")]);
615-
assert_eq!(glob_vec("aaa*/"), ~[abs_path("aaa")]);
616-
617-
assert_eq!(glob_vec("aaa/*"), ~[
618-
abs_path("aaa/apple"),
619-
abs_path("aaa/orange"),
620-
abs_path("aaa/tomato")]);
621-
622-
assert_eq!(glob_vec("aaa/*a*"), ~[
623-
abs_path("aaa/apple"),
624-
abs_path("aaa/orange"),
625-
abs_path("aaa/tomato")]);
626-
627-
assert_eq!(glob_vec("*/*/*.txt"), ~[
628-
abs_path("aaa/tomato/tomato.txt"),
629-
abs_path("aaa/tomato/tomoto.txt")]);
630-
631-
assert_eq!(glob_vec("*/*/t[aob]m?to[.]t[!y]t"), ~[
632-
abs_path("aaa/tomato/tomato.txt"),
633-
abs_path("aaa/tomato/tomoto.txt")]);
634-
635-
assert_eq!(glob_vec("aa[a]"), ~[abs_path("aaa")]);
636-
assert_eq!(glob_vec("aa[abc]"), ~[abs_path("aaa")]);
637-
assert_eq!(glob_vec("a[bca]a"), ~[abs_path("aaa")]);
638-
assert_eq!(glob_vec("aa[b]"), ~[]);
639-
assert_eq!(glob_vec("aa[xyz]"), ~[]);
640-
assert_eq!(glob_vec("aa[]]"), ~[]);
641-
642-
assert_eq!(glob_vec("aa[!b]"), ~[abs_path("aaa")]);
643-
assert_eq!(glob_vec("aa[!bcd]"), ~[abs_path("aaa")]);
644-
assert_eq!(glob_vec("a[!bcd]a"), ~[abs_path("aaa")]);
645-
assert_eq!(glob_vec("aa[!a]"), ~[]);
646-
assert_eq!(glob_vec("aa[!abc]"), ~[]);
647-
648-
assert_eq!(glob_vec("bbb/specials/[[]"), ~[abs_path("bbb/specials/[")]);
649-
assert_eq!(glob_vec("bbb/specials/!"), ~[abs_path("bbb/specials/!")]);
650-
assert_eq!(glob_vec("bbb/specials/[]]"), ~[abs_path("bbb/specials/]")]);
651-
652-
if os::consts::FAMILY != os::consts::windows::FAMILY {
653-
assert_eq!(glob_vec("bbb/specials/[*]"), ~[abs_path("bbb/specials/*")]);
654-
assert_eq!(glob_vec("bbb/specials/[?]"), ~[abs_path("bbb/specials/?")]);
655-
}
656-
657-
if os::consts::FAMILY == os::consts::windows::FAMILY {
658-
659-
assert_eq!(glob_vec("bbb/specials/[![]"), ~[
660-
abs_path("bbb/specials/!"),
661-
abs_path("bbb/specials/]")]);
662-
663-
assert_eq!(glob_vec("bbb/specials/[!]]"), ~[
664-
abs_path("bbb/specials/!"),
665-
abs_path("bbb/specials/[")]);
666-
667-
assert_eq!(glob_vec("bbb/specials/[!!]"), ~[
668-
abs_path("bbb/specials/["),
669-
abs_path("bbb/specials/]")]);
670-
671-
} else {
672-
673-
assert_eq!(glob_vec("bbb/specials/[![]"), ~[
674-
abs_path("bbb/specials/!"),
675-
abs_path("bbb/specials/*"),
676-
abs_path("bbb/specials/?"),
677-
abs_path("bbb/specials/]")]);
678-
679-
assert_eq!(glob_vec("bbb/specials/[!]]"), ~[
680-
abs_path("bbb/specials/!"),
681-
abs_path("bbb/specials/*"),
682-
abs_path("bbb/specials/?"),
683-
abs_path("bbb/specials/[")]);
684-
685-
assert_eq!(glob_vec("bbb/specials/[!!]"), ~[
686-
abs_path("bbb/specials/*"),
687-
abs_path("bbb/specials/?"),
688-
abs_path("bbb/specials/["),
689-
abs_path("bbb/specials/]")]);
690-
691-
assert_eq!(glob_vec("bbb/specials/[!*]"), ~[
692-
abs_path("bbb/specials/!"),
693-
abs_path("bbb/specials/?"),
694-
abs_path("bbb/specials/["),
695-
abs_path("bbb/specials/]")]);
696-
697-
assert_eq!(glob_vec("bbb/specials/[!?]"), ~[
698-
abs_path("bbb/specials/!"),
699-
abs_path("bbb/specials/*"),
700-
abs_path("bbb/specials/["),
701-
abs_path("bbb/specials/]")]);
702-
703-
}
704-
};
705-
}
706-
707519
#[test]
708520
fn test_absolute_pattern() {
709521
// assume that the filesystem is not empty!

branches/try2/src/librustc/middle/stack_check.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,6 @@ fn stack_check_item(v: StackCheckVisitor,
8080
visit::walk_method_helper(&mut v, method, new_cx);
8181
}
8282
}
83-
ast::item_trait(_, _, ref methods) => {
84-
for method in methods.iter() {
85-
match *method {
86-
ast::provided(@ref method) => {
87-
let safe_stack = fixed_stack_segment(method.attrs);
88-
let new_cx = Context {safe_stack: safe_stack, ..in_cx};
89-
visit::walk_method_helper(&mut v, method, new_cx);
90-
}
91-
ast::required(*) => ()
92-
}
93-
}
94-
}
9583
_ => {
9684
visit::walk_item(&mut v, item, in_cx);
9785
}

branches/try2/src/librustpkg/package_source.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use context::*;
1818
use crate::Crate;
1919
use messages::*;
2020
use source_control::{git_clone, git_clone_general};
21-
use path_util::{find_dir_using_rust_path_hack, default_workspace, make_dir_rwx_recursive};
21+
use path_util::{find_dir_using_rust_path_hack, default_workspace};
2222
use util::compile_crate;
2323
use workspace::is_workspace;
2424
use workcache_support;
@@ -197,14 +197,12 @@ impl PkgSrc {
197197
url, clone_target.to_str(), pkgid.version.to_str());
198198

199199
if git_clone_general(url, &clone_target, &pkgid.version) {
200-
// Since the operation succeeded, move clone_target to local.
201-
// First, create all ancestor directories.
202-
if make_dir_rwx_recursive(&local.pop())
203-
&& os::rename_file(&clone_target, local) {
204-
Some(local.clone())
200+
// since the operation succeeded, move clone_target to local
201+
if !os::rename_file(&clone_target, local) {
202+
None
205203
}
206204
else {
207-
None
205+
Some(local.clone())
208206
}
209207
}
210208
else {

branches/try2/src/librustpkg/path_util.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ pub static U_RWX: i32 = (S_IRUSR | S_IWUSR | S_IXUSR) as i32;
4343
/// succeeded.
4444
pub fn make_dir_rwx(p: &Path) -> bool { os::make_dir(p, U_RWX) }
4545

46-
pub fn make_dir_rwx_recursive(p: &Path) -> bool { os::mkdir_recursive(p, U_RWX) }
47-
4846
// n.b. The next three functions ignore the package version right
4947
// now. Should fix that.
5048

@@ -401,12 +399,3 @@ pub fn find_dir_using_rust_path_hack(p: &PkgId) -> Option<Path> {
401399
}
402400
None
403401
}
404-
405-
/// True if the user set RUST_PATH to something non-empty --
406-
/// as opposed to the default paths that rustpkg adds automatically
407-
pub fn user_set_rust_path() -> bool {
408-
match os::getenv("RUST_PATH") {
409-
None | Some(~"") => false,
410-
Some(_) => true
411-
}
412-
}

0 commit comments

Comments
 (0)