Skip to content

Commit 40ab198

Browse files
committed
rustc: Use libnative for the compiler
The compiler itself doesn't necessarily need any features of green threading such as spawning tasks and lots of I/O, so libnative is slightly more appropriate for rustc to use itself. This should also help the rusti bot which is currently incompatible with libuv.
1 parent cd9010c commit 40ab198

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

mk/crates.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ DEPS_test := std extra collections getopts serialize term
8181
DEPS_time := std serialize
8282

8383
TOOL_DEPS_compiletest := test green rustuv getopts
84-
TOOL_DEPS_rustdoc := rustdoc green rustuv
85-
TOOL_DEPS_rustc := rustc green rustuv
84+
TOOL_DEPS_rustdoc := rustdoc native
85+
TOOL_DEPS_rustc := rustc native
8686
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
8787
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
8888
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs

src/driver/driver.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[no_uv];
12+
1113
#[cfg(rustdoc)]
1214
extern crate this = "rustdoc";
1315

1416
#[cfg(rustc)]
1517
extern crate this = "rustc";
1618

17-
fn main() { this::main() }
19+
extern crate native;
20+
21+
#[start]
22+
fn start(argc: int, argv: **u8) -> int { native::start(argc, argv, this::main) }

src/libnative/io/file_win32.rs

+1
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ pub fn readlink(p: &CString) -> IoResult<Path> {
433433
libc::VOLUME_NAME_DOS)
434434
});
435435
let ret = match ret {
436+
Some(ref s) if s.starts_with(r"\\?\") => Ok(Path::new(s.slice_from(4))),
436437
Some(s) => Ok(Path::new(s)),
437438
None => Err(super::last_error()),
438439
};

src/libstd/io/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,6 @@ mod test {
12171217

12181218
check!(File::create(&tmpdir.join("test")).write(bytes));
12191219
let actual = check!(File::open(&tmpdir.join("test")).read_to_end());
1220-
assert!(actual.as_slice == bytes);
1220+
assert!(actual.as_slice() == bytes);
12211221
})
12221222
}

0 commit comments

Comments
 (0)