Skip to content

Commit 87b5329

Browse files
committed
---
yaml --- r: 80591 b: refs/heads/auto c: 38d4f48 h: refs/heads/master i: 80589: af041e9 80587: 05ef506 80583: 761dbee 80575: fb5dcc2 v: v3
1 parent 308edb4 commit 87b5329

File tree

11 files changed

+66
-47
lines changed

11 files changed

+66
-47
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 1afaf0b308618c7c33fb13684105e98671b82c4b
16+
refs/heads/auto: 38d4f48f0a185cc27769a6526668baa31aeee6b9
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/doc/tutorial-tasks.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,14 @@ concurrency at this writing:
4747

4848
* [`std::task`] - All code relating to tasks and task scheduling,
4949
* [`std::comm`] - The message passing interface,
50-
* [`std::pipes`] - The underlying messaging infrastructure,
51-
* [`extra::comm`] - Additional messaging types based on `std::pipes`,
50+
* [`extra::comm`] - Additional messaging types based on `std::comm`,
5251
* [`extra::sync`] - More exotic synchronization tools, including locks,
5352
* [`extra::arc`] - The Arc (atomically reference counted) type,
5453
for safely sharing immutable data,
5554
* [`extra::future`] - A type representing values that may be computed concurrently and retrieved at a later time.
5655

5756
[`std::task`]: std/task.html
5857
[`std::comm`]: std/comm.html
59-
[`std::pipes`]: std/pipes.html
6058
[`extra::comm`]: extra/comm.html
6159
[`extra::sync`]: extra/sync.html
6260
[`extra::arc`]: extra/arc.html
@@ -125,7 +123,7 @@ receiving messages. Pipes are low-level communication building-blocks and so
125123
come in a variety of forms, each one appropriate for a different use case. In
126124
what follows, we cover the most commonly used varieties.
127125

128-
The simplest way to create a pipe is to use the `pipes::stream`
126+
The simplest way to create a pipe is to use the `comm::stream`
129127
function to create a `(Port, Chan)` pair. In Rust parlance, a *channel*
130128
is a sending endpoint of a pipe, and a *port* is the receiving
131129
endpoint. Consider the following example of calculating two results

branches/auto/src/libextra/fileinput.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ mod test {
433433
}
434434

435435
#[test]
436-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
437436
fn test_make_path_option_vec() {
438437
let strs = [~"some/path",
439438
~"some/other/path"];
@@ -448,7 +447,6 @@ mod test {
448447
}
449448
450449
#[test]
451-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
452450
fn test_fileinput_read_byte() {
453451
let filenames = make_path_option_vec(vec::from_fn(
454452
3,
@@ -479,7 +477,6 @@ mod test {
479477
}
480478
481479
#[test]
482-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
483480
fn test_fileinput_read() {
484481
let filenames = make_path_option_vec(vec::from_fn(
485482
3,
@@ -500,7 +497,6 @@ mod test {
500497
}
501498

502499
#[test]
503-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
504500
fn test_input_vec() {
505501
let mut all_lines = ~[];
506502
let filenames = make_path_option_vec(vec::from_fn(
@@ -524,7 +520,6 @@ mod test {
524520
}
525521

526522
#[test]
527-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
528523
fn test_input_vec_state() {
529524
let filenames = make_path_option_vec(vec::from_fn(
530525
3,
@@ -547,7 +542,6 @@ mod test {
547542
}
548543

549544
#[test]
550-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
551545
fn test_empty_files() {
552546
let filenames = make_path_option_vec(vec::from_fn(
553547
3,
@@ -572,7 +566,6 @@ mod test {
572566
}
573567
574568
#[test]
575-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
576569
fn test_no_trailing_newline() {
577570
let f1 =
578571
Some(Path("tmp/lib-fileinput-test-no-trailing-newline-1.tmp"));
@@ -598,7 +591,6 @@ mod test {
598591
599592
600593
#[test]
601-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
602594
fn test_next_file() {
603595
let filenames = make_path_option_vec(vec::from_fn(
604596
3,
@@ -630,7 +622,6 @@ mod test {
630622
631623
#[test]
632624
#[should_fail]
633-
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
634625
fn test_input_vec_missing_file() {
635626
do input_vec(make_path_option_vec([~"this/file/doesnt/exist"], true)) |line| {
636627
println(line);

branches/auto/src/libextra/workcache.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -496,16 +496,23 @@ fn test() {
496496
use std::io::WriterUtil;
497497
use std::{os, run};
498498

499-
let pth = Path("foo.c");
499+
// Create a path to a new file 'filename' in the directory in which
500+
// this test is running.
501+
fn make_path(filename: ~str) -> Path {
502+
let pth = os::self_exe_path().expect("workcache::test failed").pop().push(filename);
503+
if os::path_exists(&pth) {
504+
os::remove_file(&pth);
505+
}
506+
return pth;
507+
}
508+
509+
let pth = make_path(~"foo.c");
500510
{
501511
let r = io::file_writer(&pth, [io::Create]);
502512
r.unwrap().write_str("int main() { return 0; }");
503513
}
504514

505-
let db_path = os::self_exe_path().expect("workcache::test failed").pop().push("db.json");
506-
if os::path_exists(&db_path) {
507-
os::remove_file(&db_path);
508-
}
515+
let db_path = make_path(~"db.json");
509516

510517
let cx = Context::new(RWArc::new(Database::new(db_path)),
511518
RWArc::new(Logger::new()),
@@ -514,17 +521,19 @@ fn test() {
514521
let s = do cx.with_prep("test1") |prep| {
515522

516523
let subcx = cx.clone();
524+
let pth = pth.clone();
517525

518526
prep.declare_input("file", pth.to_str(), digest_file(&pth));
519527
do prep.exec |_exe| {
520-
let out = Path("foo.o");
521-
run::process_status("gcc", [~"foo.c", ~"-o", out.to_str()]);
528+
let out = make_path(~"foo.o");
529+
run::process_status("gcc", [pth.to_str(), ~"-o", out.to_str()]);
522530

523531
let _proof_of_concept = subcx.prep("subfn");
524532
// Could run sub-rules inside here.
525533

526534
out.to_str()
527535
}
528536
};
537+
529538
io::println(s);
530539
}

branches/auto/src/libstd/os.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,18 +1135,19 @@ pub fn last_os_error() -> ~str {
11351135
#[fixed_stack_segment]; #[inline(never)];
11361136

11371137
use libc::types::os::arch::extra::DWORD;
1138-
use libc::types::os::arch::extra::LPSTR;
1138+
use libc::types::os::arch::extra::LPWSTR;
11391139
use libc::types::os::arch::extra::LPVOID;
1140+
use libc::types::os::arch::extra::WCHAR;
11401141

11411142
#[cfg(target_arch = "x86")]
11421143
#[link_name = "kernel32"]
11431144
#[abi = "stdcall"]
11441145
extern "stdcall" {
1145-
fn FormatMessageA(flags: DWORD,
1146+
fn FormatMessageW(flags: DWORD,
11461147
lpSrc: LPVOID,
11471148
msgId: DWORD,
11481149
langId: DWORD,
1149-
buf: LPSTR,
1150+
buf: LPWSTR,
11501151
nsize: DWORD,
11511152
args: *c_void)
11521153
-> DWORD;
@@ -1155,11 +1156,11 @@ pub fn last_os_error() -> ~str {
11551156
#[cfg(target_arch = "x86_64")]
11561157
#[link_name = "kernel32"]
11571158
extern {
1158-
fn FormatMessageA(flags: DWORD,
1159+
fn FormatMessageW(flags: DWORD,
11591160
lpSrc: LPVOID,
11601161
msgId: DWORD,
11611162
langId: DWORD,
1162-
buf: LPSTR,
1163+
buf: LPWSTR,
11631164
nsize: DWORD,
11641165
args: *c_void)
11651166
-> DWORD;
@@ -1173,11 +1174,11 @@ pub fn last_os_error() -> ~str {
11731174
let langId = 0x0800 as DWORD;
11741175
let err = errno() as DWORD;
11751176

1176-
let mut buf = [0 as c_char, ..TMPBUF_SZ];
1177+
let mut buf = [0 as WCHAR, ..TMPBUF_SZ];
11771178

11781179
unsafe {
11791180
do buf.as_mut_buf |buf, len| {
1180-
let res = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
1181+
let res = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM |
11811182
FORMAT_MESSAGE_IGNORE_INSERTS,
11821183
ptr::mut_null(),
11831184
err,
@@ -1190,9 +1191,7 @@ pub fn last_os_error() -> ~str {
11901191
}
11911192
}
11921193

1193-
do buf.as_imm_buf |buf, _len| {
1194-
str::raw::from_c_str(buf)
1195-
}
1194+
str::from_utf16(buf)
11961195
}
11971196
}
11981197

branches/auto/src/libstd/rt/io/file.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ fn file_test_smoke_test_impl() {
168168
}
169169

170170
#[test]
171-
#[ignore(cfg(windows))] // FIXME #8810
172171
fn file_test_io_smoke_test() {
173172
file_test_smoke_test_impl();
174173
}
@@ -236,7 +235,6 @@ fn file_test_io_non_positional_read_impl() {
236235
}
237236

238237
#[test]
239-
#[ignore(cfg(windows))] // FIXME #8810
240238
fn file_test_io_non_positional_read() {
241239
file_test_io_non_positional_read_impl();
242240
}
@@ -268,8 +266,8 @@ fn file_test_io_seeking_impl() {
268266
assert!(tell_pos_post_read == message.len() as u64);
269267
}
270268
}
269+
271270
#[test]
272-
#[ignore(cfg(windows))] // FIXME #8810
273271
fn file_test_io_seek_and_tell_smoke_test() {
274272
file_test_io_seeking_impl();
275273
}
@@ -300,8 +298,8 @@ fn file_test_io_seek_and_write_impl() {
300298
assert!(read_str == final_msg.to_owned());
301299
}
302300
}
301+
303302
#[test]
304-
#[ignore(cfg(windows))] // FIXME #8810
305303
fn file_test_io_seek_and_write() {
306304
file_test_io_seek_and_write_impl();
307305
}
@@ -340,8 +338,8 @@ fn file_test_io_seek_shakedown_impl() {
340338
unlink(filename);
341339
}
342340
}
341+
343342
#[test]
344-
#[ignore(cfg(windows))] // FIXME #8810
345343
fn file_test_io_seek_shakedown() {
346344
file_test_io_seek_shakedown_impl();
347345
}

branches/auto/src/libstd/rt/io/net/tcp.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,17 @@ mod test {
178178
}
179179

180180
#[test]
181-
#[ignore(cfg(windows))] // FIXME #8811
182181
fn connect_error() {
183182
do run_in_mt_newsched_task {
184183
let mut called = false;
185184
do io_error::cond.trap(|e| {
186-
assert_eq!(e.kind, ConnectionRefused);
185+
let expected_error = if cfg!(unix) {
186+
ConnectionRefused
187+
} else {
188+
// On Win32, opening port 1 gives WSAEADDRNOTAVAIL error.
189+
OtherIoError
190+
};
191+
assert_eq!(e.kind, expected_error);
187192
called = true;
188193
}).inside {
189194
let addr = SocketAddr { ip: Ipv4Addr(0, 0, 0, 0), port: 1 };

branches/auto/src/libstd/rt/io/support.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ mod test {
3333
use super::PathLike;
3434

3535
#[test]
36-
#[ignore(cfg(windows))] // FIXME #8812
3736
fn path_like_smoke_test() {
38-
let expected = "/home";
37+
let expected = if cfg!(unix) { "/home" } else { "C:\\" };
3938
let path = Path(expected);
4039
path.path_as_str(|p| assert!(p == expected));
4140
path.path_as_str(|p| assert!(p == expected));

branches/auto/src/libstd/rt/uv/file.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,11 @@ mod test {
408408
}
409409
410410
#[test]
411-
#[ignore(cfg(windows))] // FIXME #8814
412411
fn file_test_full_simple() {
413412
file_test_full_simple_impl();
414413
}
415414
416415
#[test]
417-
#[ignore(cfg(windows))] // FIXME #8814
418416
fn file_test_full_simple_sync() {
419417
file_test_full_simple_impl_sync();
420418
}

branches/auto/src/libstd/rt/uv/uvio.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,6 @@ fn test_read_read_read() {
17401740
}
17411741

17421742
#[test]
1743-
#[ignore(cfg(windows))] // FIXME #8816
17441743
fn test_udp_twice() {
17451744
do run_in_mt_newsched_task {
17461745
let server_addr = next_test_ip4();
@@ -1892,7 +1891,6 @@ fn file_test_uvio_full_simple_impl() {
18921891
}
18931892

18941893
#[test]
1895-
#[ignore(cfg(windows))] // FIXME #8816
18961894
fn file_test_uvio_full_simple() {
18971895
do run_in_mt_newsched_task {
18981896
file_test_uvio_full_simple_impl();

branches/auto/src/libstd/rt/uv/uvll.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ pub enum uv_handle_type {
237237
UV_HANDLE_TYPE_MAX
238238
}
239239

240+
#[cfg(unix)]
240241
#[deriving(Eq)]
241242
pub enum uv_req_type {
242243
UV_UNKNOWN_REQ,
@@ -251,6 +252,31 @@ pub enum uv_req_type {
251252
UV_REQ_TYPE_MAX
252253
}
253254

255+
// uv_req_type may have additional fields defined by UV_REQ_TYPE_PRIVATE.
256+
// See UV_REQ_TYPE_PRIVATE at libuv/include/uv-win.h
257+
#[cfg(windows)]
258+
#[deriving(Eq)]
259+
pub enum uv_req_type {
260+
UV_UNKNOWN_REQ,
261+
UV_REQ,
262+
UV_CONNECT,
263+
UV_WRITE,
264+
UV_SHUTDOWN,
265+
UV_UDP_SEND,
266+
UV_FS,
267+
UV_WORK,
268+
UV_GETADDRINFO,
269+
UV_ACCEPT,
270+
UV_FS_EVENT_REQ,
271+
UV_POLL_REQ,
272+
UV_PROCESS_EXIT,
273+
UV_READ,
274+
UV_UDP_RECV,
275+
UV_WAKEUP,
276+
UV_SIGNAL_REQ,
277+
UV_REQ_TYPE_MAX
278+
}
279+
254280
#[deriving(Eq)]
255281
pub enum uv_membership {
256282
UV_LEAVE_GROUP,
@@ -298,10 +324,8 @@ fn handle_sanity_check() {
298324
}
299325

300326
#[test]
301-
#[ignore(cfg(windows))] // FIXME #8817
302-
#[fixed_stack_segment]
303-
#[inline(never)]
304327
fn request_sanity_check() {
328+
#[fixed_stack_segment]; #[inline(never)];
305329
unsafe {
306330
assert_eq!(UV_REQ_TYPE_MAX as uint, rust_uv_req_type_max());
307331
}

0 commit comments

Comments
 (0)