Skip to content

Commit 8b19ffe

Browse files
committed
---
yaml --- r: 80868 b: refs/heads/try c: edf20cc h: refs/heads/master v: v3
1 parent f2bdc6d commit 8b19ffe

File tree

12 files changed

+83
-64
lines changed

12 files changed

+83
-64
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: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: 0ec4d34b3f0fa1897ace96475a32ff0c8e15b33b
5+
refs/heads/try: edf20ccc1b28a17c5acd1442f6341eb21015a8ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libextra/fileinput.rs

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

435435
#[test]
436+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
436437
fn test_make_path_option_vec() {
437438
let strs = [~"some/path",
438439
~"some/other/path"];
@@ -447,6 +448,7 @@ mod test {
447448
}
448449
449450
#[test]
451+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
450452
fn test_fileinput_read_byte() {
451453
let filenames = make_path_option_vec(vec::from_fn(
452454
3,
@@ -477,6 +479,7 @@ mod test {
477479
}
478480
479481
#[test]
482+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
480483
fn test_fileinput_read() {
481484
let filenames = make_path_option_vec(vec::from_fn(
482485
3,
@@ -497,6 +500,7 @@ mod test {
497500
}
498501

499502
#[test]
503+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
500504
fn test_input_vec() {
501505
let mut all_lines = ~[];
502506
let filenames = make_path_option_vec(vec::from_fn(
@@ -520,6 +524,7 @@ mod test {
520524
}
521525

522526
#[test]
527+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
523528
fn test_input_vec_state() {
524529
let filenames = make_path_option_vec(vec::from_fn(
525530
3,
@@ -542,6 +547,7 @@ mod test {
542547
}
543548

544549
#[test]
550+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
545551
fn test_empty_files() {
546552
let filenames = make_path_option_vec(vec::from_fn(
547553
3,
@@ -566,6 +572,7 @@ mod test {
566572
}
567573
568574
#[test]
575+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
569576
fn test_no_trailing_newline() {
570577
let f1 =
571578
Some(Path("tmp/lib-fileinput-test-no-trailing-newline-1.tmp"));
@@ -591,6 +598,7 @@ mod test {
591598
592599
593600
#[test]
601+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
594602
fn test_next_file() {
595603
let filenames = make_path_option_vec(vec::from_fn(
596604
3,
@@ -622,6 +630,7 @@ mod test {
622630
623631
#[test]
624632
#[should_fail]
633+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
625634
fn test_input_vec_missing_file() {
626635
do input_vec(make_path_option_vec([~"this/file/doesnt/exist"], true)) |line| {
627636
println(line);

branches/try/src/libextra/workcache.rs

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

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");
499+
let pth = Path("foo.c");
510500
{
511501
let r = io::file_writer(&pth, [io::Create]);
512502
r.unwrap().write_str("int main() { return 0; }");
513503
}
514504

515-
let db_path = make_path(~"db.json");
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+
}
516509

517510
let cx = Context::new(RWArc::new(Database::new(db_path)),
518511
RWArc::new(Logger::new()),
@@ -521,19 +514,17 @@ fn test() {
521514
let s = do cx.with_prep("test1") |prep| {
522515

523516
let subcx = cx.clone();
524-
let pth = pth.clone();
525517

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

531523
let _proof_of_concept = subcx.prep("subfn");
532524
// Could run sub-rules inside here.
533525

534526
out.to_str()
535527
}
536528
};
537-
538529
io::println(s);
539530
}

branches/try/src/libstd/os.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,19 +1135,18 @@ 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::LPWSTR;
1138+
use libc::types::os::arch::extra::LPSTR;
11391139
use libc::types::os::arch::extra::LPVOID;
1140-
use libc::types::os::arch::extra::WCHAR;
11411140

11421141
#[cfg(target_arch = "x86")]
11431142
#[link_name = "kernel32"]
11441143
#[abi = "stdcall"]
11451144
extern "stdcall" {
1146-
fn FormatMessageW(flags: DWORD,
1145+
fn FormatMessageA(flags: DWORD,
11471146
lpSrc: LPVOID,
11481147
msgId: DWORD,
11491148
langId: DWORD,
1150-
buf: LPWSTR,
1149+
buf: LPSTR,
11511150
nsize: DWORD,
11521151
args: *c_void)
11531152
-> DWORD;
@@ -1156,11 +1155,11 @@ pub fn last_os_error() -> ~str {
11561155
#[cfg(target_arch = "x86_64")]
11571156
#[link_name = "kernel32"]
11581157
extern {
1159-
fn FormatMessageW(flags: DWORD,
1158+
fn FormatMessageA(flags: DWORD,
11601159
lpSrc: LPVOID,
11611160
msgId: DWORD,
11621161
langId: DWORD,
1163-
buf: LPWSTR,
1162+
buf: LPSTR,
11641163
nsize: DWORD,
11651164
args: *c_void)
11661165
-> DWORD;
@@ -1174,11 +1173,11 @@ pub fn last_os_error() -> ~str {
11741173
let langId = 0x0800 as DWORD;
11751174
let err = errno() as DWORD;
11761175

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

11791178
unsafe {
11801179
do buf.as_mut_buf |buf, len| {
1181-
let res = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM |
1180+
let res = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
11821181
FORMAT_MESSAGE_IGNORE_INSERTS,
11831182
ptr::mut_null(),
11841183
err,
@@ -1191,7 +1190,9 @@ pub fn last_os_error() -> ~str {
11911190
}
11921191
}
11931192

1194-
str::from_utf16(buf)
1193+
do buf.as_imm_buf |buf, _len| {
1194+
str::raw::from_c_str(buf)
1195+
}
11951196
}
11961197
}
11971198

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

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

170170
#[test]
171+
#[ignore(cfg(windows))] // FIXME #8810
171172
fn file_test_io_smoke_test() {
172173
file_test_smoke_test_impl();
173174
}
@@ -235,6 +236,7 @@ fn file_test_io_non_positional_read_impl() {
235236
}
236237

237238
#[test]
239+
#[ignore(cfg(windows))] // FIXME #8810
238240
fn file_test_io_non_positional_read() {
239241
file_test_io_non_positional_read_impl();
240242
}
@@ -266,8 +268,8 @@ fn file_test_io_seeking_impl() {
266268
assert!(tell_pos_post_read == message.len() as u64);
267269
}
268270
}
269-
270271
#[test]
272+
#[ignore(cfg(windows))] // FIXME #8810
271273
fn file_test_io_seek_and_tell_smoke_test() {
272274
file_test_io_seeking_impl();
273275
}
@@ -298,8 +300,8 @@ fn file_test_io_seek_and_write_impl() {
298300
assert!(read_str == final_msg.to_owned());
299301
}
300302
}
301-
302303
#[test]
304+
#[ignore(cfg(windows))] // FIXME #8810
303305
fn file_test_io_seek_and_write() {
304306
file_test_io_seek_and_write_impl();
305307
}
@@ -338,8 +340,8 @@ fn file_test_io_seek_shakedown_impl() {
338340
unlink(filename);
339341
}
340342
}
341-
342343
#[test]
344+
#[ignore(cfg(windows))] // FIXME #8810
343345
fn file_test_io_seek_shakedown() {
344346
file_test_io_seek_shakedown_impl();
345347
}

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

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

180180
#[test]
181+
#[ignore(cfg(windows))] // FIXME #8811
181182
fn connect_error() {
182183
do run_in_mt_newsched_task {
183184
let mut called = false;
184185
do io_error::cond.trap(|e| {
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);
186+
assert_eq!(e.kind, ConnectionRefused);
192187
called = true;
193188
}).inside {
194189
let addr = SocketAddr { ip: Ipv4Addr(0, 0, 0, 0), port: 1 };

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

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

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,13 @@ mod test {
408408
}
409409
410410
#[test]
411+
#[ignore(cfg(windows))] // FIXME #8814
411412
fn file_test_full_simple() {
412413
file_test_full_simple_impl();
413414
}
414415
415416
#[test]
417+
#[ignore(cfg(windows))] // FIXME #8814
416418
fn file_test_full_simple_sync() {
417419
file_test_full_simple_impl_sync();
418420
}

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

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

17421742
#[test]
1743+
#[ignore(cfg(windows))] // FIXME #8816
17431744
fn test_udp_twice() {
17441745
do run_in_mt_newsched_task {
17451746
let server_addr = next_test_ip4();
@@ -1891,6 +1892,7 @@ fn file_test_uvio_full_simple_impl() {
18911892
}
18921893

18931894
#[test]
1895+
#[ignore(cfg(windows))] // FIXME #8816
18941896
fn file_test_uvio_full_simple() {
18951897
do run_in_mt_newsched_task {
18961898
file_test_uvio_full_simple_impl();

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

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

240-
#[cfg(unix)]
241240
#[deriving(Eq)]
242241
pub enum uv_req_type {
243242
UV_UNKNOWN_REQ,
@@ -252,31 +251,6 @@ pub enum uv_req_type {
252251
UV_REQ_TYPE_MAX
253252
}
254253

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-
280254
#[deriving(Eq)]
281255
pub enum uv_membership {
282256
UV_LEAVE_GROUP,
@@ -324,8 +298,10 @@ fn handle_sanity_check() {
324298
}
325299

326300
#[test]
301+
#[ignore(cfg(windows))] // FIXME #8817
302+
#[fixed_stack_segment]
303+
#[inline(never)]
327304
fn request_sanity_check() {
328-
#[fixed_stack_segment]; #[inline(never)];
329305
unsafe {
330306
assert_eq!(UV_REQ_TYPE_MAX as uint, rust_uv_req_type_max());
331307
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[link(name = "numeric",
12+
vers = "0.1")];
13+
#[crate_type = "lib"];
14+
15+
pub trait Trig<T> {
16+
fn sin(&self) -> T;
17+
}
18+
19+
pub fn sin<T:Trig<R>, R>(theta: &T) -> R { theta.sin() }
20+
21+
pub trait Angle<T>: Trig<T> {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:issue-4208-cc.rs
12+
// xfail-fast - Windows hates cross-crate tests
13+
14+
extern mod numeric;
15+
use numeric::*;
16+
17+
fn foo<T, A:Angle<T>>(theta: A) -> T { sin(&theta) }
18+
19+
fn main() {}

0 commit comments

Comments
 (0)