Skip to content

Commit 14afb59

Browse files
committed
---
yaml --- r: 151091 b: refs/heads/try2 c: 899f222 h: refs/heads/master i: 151089: cfd7b9b 151087: 8d612c7 v: v3
1 parent 72db6eb commit 14afb59

File tree

134 files changed

+1062
-1393
lines changed

Some content is hidden

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

134 files changed

+1062
-1393
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: f5a5d7c32ca863533e53175da8afab6ba8d20f30
8+
refs/heads/try2: 899f22238669bade874f29f784cdffba28ff0982
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/tests.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ endif
526526
# triples). The associated message will be printed as a warning
527527
# during attempts to run those tests.
528528

529+
CTEST_DISABLE_NONSELFHOST_rpass-full = "run-pass-full suite is unavailable when cross-compiling."
530+
529531
define DEF_CTEST_VARS
530532

531533
# All the per-stage build rules you might want to call from the
@@ -571,7 +573,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
571573
$$(CTEST_TESTARGS)
572574

573575
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
574-
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
576+
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(2)_H_$(3))
575577
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
576578
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
577579
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)

branches/try2/src/libcollections/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ impl<'a> RandomAccessIterator<bool> for Bits<'a> {
632632
}
633633

634634
#[inline]
635-
fn idx(&mut self, index: uint) -> Option<bool> {
635+
fn idx(&self, index: uint) -> Option<bool> {
636636
if index >= self.indexable() {
637637
None
638638
} else {

branches/try2/src/libcollections/ringbuf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl<'a, T> RandomAccessIterator<&'a T> for Items<'a, T> {
272272
fn indexable(&self) -> uint { self.rindex - self.index }
273273

274274
#[inline]
275-
fn idx(&mut self, j: uint) -> Option<&'a T> {
275+
fn idx(&self, j: uint) -> Option<&'a T> {
276276
if j >= self.indexable() {
277277
None
278278
} else {

branches/try2/src/libfourcc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
9191

9292
let s = match expr.node {
9393
// expression is a literal
94-
ast::ExprLit(ref lit) => match lit.node {
94+
ast::ExprLit(lit) => match lit.node {
9595
// string literal
9696
ast::LitStr(ref s, _) => {
9797
if s.get().char_len() != 4 {

branches/try2/src/libnative/io/c_win32.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ extern "system" {
5050
pub fn ioctlsocket(s: libc::SOCKET, cmd: libc::c_long,
5151
argp: *mut libc::c_ulong) -> libc::c_int;
5252
pub fn select(nfds: libc::c_int,
53-
readfds: *fd_set,
54-
writefds: *fd_set,
55-
exceptfds: *fd_set,
53+
readfds: *mut fd_set,
54+
writefds: *mut fd_set,
55+
exceptfds: *mut fd_set,
5656
timeout: *libc::timeval) -> libc::c_int;
5757
pub fn getsockopt(sockfd: libc::SOCKET,
5858
level: libc::c_int,

branches/try2/src/libnative/io/net.rs

Lines changed: 27 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use std::cast;
1313
use std::io::net::ip;
1414
use std::io;
1515
use std::mem;
16-
use std::os;
1716
use std::ptr;
1817
use std::rt::rtio;
1918
use std::sync::arc::UnsafeArc;
@@ -145,21 +144,6 @@ fn last_error() -> io::IoError {
145144
super::last_error()
146145
}
147146

148-
fn ms_to_timeval(ms: u64) -> libc::timeval {
149-
libc::timeval {
150-
tv_sec: (ms / 1000) as libc::time_t,
151-
tv_usec: ((ms % 1000) * 1000) as libc::suseconds_t,
152-
}
153-
}
154-
155-
fn timeout(desc: &'static str) -> io::IoError {
156-
io::IoError {
157-
kind: io::TimedOut,
158-
desc: desc,
159-
detail: None,
160-
}
161-
}
162-
163147
#[cfg(windows)] unsafe fn close(sock: sock_t) { let _ = libc::closesocket(sock); }
164148
#[cfg(unix)] unsafe fn close(sock: sock_t) { let _ = libc::close(sock); }
165149

@@ -287,7 +271,8 @@ impl TcpStream {
287271
fn connect_timeout(fd: sock_t,
288272
addrp: *libc::sockaddr,
289273
len: libc::socklen_t,
290-
timeout_ms: u64) -> IoResult<()> {
274+
timeout: u64) -> IoResult<()> {
275+
use std::os;
291276
#[cfg(unix)] use INPROGRESS = libc::EINPROGRESS;
292277
#[cfg(windows)] use INPROGRESS = libc::WSAEINPROGRESS;
293278
#[cfg(unix)] use WOULDBLOCK = libc::EWOULDBLOCK;
@@ -304,8 +289,12 @@ impl TcpStream {
304289
os::errno() as int == WOULDBLOCK as int => {
305290
let mut set: c::fd_set = unsafe { mem::init() };
306291
c::fd_set(&mut set, fd);
307-
match await(fd, &mut set, timeout_ms) {
308-
0 => Err(timeout("connection timed out")),
292+
match await(fd, &mut set, timeout) {
293+
0 => Err(io::IoError {
294+
kind: io::TimedOut,
295+
desc: "connection timed out",
296+
detail: None,
297+
}),
309298
-1 => Err(last_error()),
310299
_ => {
311300
let err: libc::c_int = try!(
@@ -349,14 +338,22 @@ impl TcpStream {
349338
// Recalculate the timeout each iteration (it is generally
350339
// undefined what the value of the 'tv' is after select
351340
// returns EINTR).
352-
let tv = ms_to_timeval(timeout - (::io::timer::now() - start));
353-
c::select(fd + 1, ptr::null(), &*set, ptr::null(), &tv)
341+
let timeout = timeout - (::io::timer::now() - start);
342+
let tv = libc::timeval {
343+
tv_sec: (timeout / 1000) as libc::time_t,
344+
tv_usec: ((timeout % 1000) * 1000) as libc::suseconds_t,
345+
};
346+
c::select(fd + 1, ptr::null(), set as *mut _ as *_,
347+
ptr::null(), &tv)
354348
})
355349
}
356350
#[cfg(windows)]
357351
fn await(_fd: sock_t, set: &mut c::fd_set, timeout: u64) -> libc::c_int {
358-
let tv = ms_to_timeval(timeout);
359-
unsafe { c::select(1, ptr::null(), &*set, ptr::null(), &tv) }
352+
let tv = libc::timeval {
353+
tv_sec: (timeout / 1000) as libc::time_t,
354+
tv_usec: ((timeout % 1000) * 1000) as libc::suseconds_t,
355+
};
356+
unsafe { c::select(1, ptr::mut_null(), set, ptr::mut_null(), &tv) }
360357
}
361358
}
362359

@@ -470,7 +467,7 @@ impl Drop for Inner {
470467
////////////////////////////////////////////////////////////////////////////////
471468

472469
pub struct TcpListener {
473-
inner: Inner,
470+
inner: UnsafeArc<Inner>,
474471
}
475472

476473
impl TcpListener {
@@ -480,7 +477,7 @@ impl TcpListener {
480477
let (addr, len) = addr_to_sockaddr(addr);
481478
let addrp = &addr as *libc::sockaddr_storage;
482479
let inner = Inner { fd: fd };
483-
let ret = TcpListener { inner: inner };
480+
let ret = TcpListener { inner: UnsafeArc::new(inner) };
484481
// On platforms with Berkeley-derived sockets, this allows
485482
// to quickly rebind a socket, without needing to wait for
486483
// the OS to clean up the previous one.
@@ -501,12 +498,15 @@ impl TcpListener {
501498
}
502499
}
503500

504-
pub fn fd(&self) -> sock_t { self.inner.fd }
501+
pub fn fd(&self) -> sock_t {
502+
// This is just a read-only arc so the unsafety is fine
503+
unsafe { (*self.inner.get()).fd }
504+
}
505505

506506
pub fn native_listen(self, backlog: int) -> IoResult<TcpAcceptor> {
507507
match unsafe { libc::listen(self.fd(), backlog as libc::c_int) } {
508508
-1 => Err(last_error()),
509-
_ => Ok(TcpAcceptor { listener: self, deadline: 0 })
509+
_ => Ok(TcpAcceptor { listener: self })
510510
}
511511
}
512512
}
@@ -525,16 +525,12 @@ impl rtio::RtioSocket for TcpListener {
525525

526526
pub struct TcpAcceptor {
527527
listener: TcpListener,
528-
deadline: u64,
529528
}
530529

531530
impl TcpAcceptor {
532531
pub fn fd(&self) -> sock_t { self.listener.fd() }
533532

534533
pub fn native_accept(&mut self) -> IoResult<TcpStream> {
535-
if self.deadline != 0 {
536-
try!(self.accept_deadline());
537-
}
538534
unsafe {
539535
let mut storage: libc::sockaddr_storage = mem::init();
540536
let storagep = &mut storage as *mut libc::sockaddr_storage;
@@ -550,25 +546,6 @@ impl TcpAcceptor {
550546
}
551547
}
552548
}
553-
554-
fn accept_deadline(&mut self) -> IoResult<()> {
555-
let mut set: c::fd_set = unsafe { mem::init() };
556-
c::fd_set(&mut set, self.fd());
557-
558-
match retry(|| {
559-
// If we're past the deadline, then pass a 0 timeout to select() so
560-
// we can poll the status of the socket.
561-
let now = ::io::timer::now();
562-
let ms = if self.deadline > now {0} else {self.deadline - now};
563-
let tv = ms_to_timeval(ms);
564-
let n = if cfg!(windows) {1} else {self.fd() as libc::c_int + 1};
565-
unsafe { c::select(n, &set, ptr::null(), ptr::null(), &tv) }
566-
}) {
567-
-1 => Err(last_error()),
568-
0 => Err(timeout("accept timed out")),
569-
_ => return Ok(()),
570-
}
571-
}
572549
}
573550

574551
impl rtio::RtioSocket for TcpAcceptor {
@@ -584,12 +561,6 @@ impl rtio::RtioTcpAcceptor for TcpAcceptor {
584561

585562
fn accept_simultaneously(&mut self) -> IoResult<()> { Ok(()) }
586563
fn dont_accept_simultaneously(&mut self) -> IoResult<()> { Ok(()) }
587-
fn set_timeout(&mut self, timeout: Option<u64>) {
588-
self.deadline = match timeout {
589-
None => 0,
590-
Some(t) => ::io::timer::now() + t,
591-
};
592-
}
593564
}
594565

595566
////////////////////////////////////////////////////////////////////////////////

branches/try2/src/libnative/io/timer_win32.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,6 @@ fn helper(input: libc::HANDLE, messages: Receiver<Req>) {
8989
}
9090
}
9191

92-
// returns the current time (in milliseconds)
93-
pub fn now() -> u64 {
94-
let mut ticks_per_s = 0;
95-
assert_eq!(unsafe { libc::QueryPerformanceFrequency(&mut ticks_per_s) }, 1);
96-
let ticks_per_s = if ticks_per_s == 0 {1} else {ticks_per_s};
97-
let mut ticks = 0;
98-
assert_eq!(unsafe { libc::QueryPerformanceCounter(&mut ticks) }, 1);
99-
100-
return (ticks as u64 * 1000) / (ticks_per_s as u64);
101-
}
102-
10392
impl Timer {
10493
pub fn new() -> IoResult<Timer> {
10594
timer_helper::boot(helper);

branches/try2/src/libnum/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ impl ToStrRadix for BigUint {
672672
s.push_str("0".repeat(l - ss.len()));
673673
s.push_str(ss);
674674
}
675-
s.as_slice().trim_left_chars('0').to_owned()
675+
s.as_slice().trim_left_chars(&'0').to_owned()
676676
}
677677
}
678678
}

branches/try2/src/librustc/back/archive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<'a> Archive<'a> {
184184
let unixlibname = format!("lib{}.a", name);
185185

186186
let mut rustpath = filesearch::rust_path();
187-
rustpath.push(self.sess.target_filesearch().get_lib_path());
187+
rustpath.push(self.sess.filesearch().get_target_lib_path());
188188
let search = self.sess.opts.addl_lib_search_paths.borrow();
189189
for path in search.iter().chain(rustpath.iter()) {
190190
debug!("looking for {} inside {}", name, path.display());

branches/try2/src/librustc/back/link.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn llvm_err(sess: &Session, msg: ~str) -> ! {
6060
if cstr == ptr::null() {
6161
sess.fatal(msg);
6262
} else {
63-
let err = CString::new(cstr, true);
63+
let err = CString::new(cstr, false);
6464
let err = str::from_utf8_lossy(err.as_bytes());
6565
sess.fatal(msg + ": " + err.as_slice());
6666
}
@@ -516,10 +516,7 @@ pub mod write {
516516

517517
pub fn find_crate_id(attrs: &[ast::Attribute], out_filestem: &str) -> CrateId {
518518
match attr::find_crateid(attrs) {
519-
None => from_str(out_filestem).unwrap_or_else(|| {
520-
let mut s = out_filestem.chars().filter(|c| c.is_XID_continue());
521-
from_str(s.collect::<~str>()).or(from_str("rust-out")).unwrap()
522-
}),
519+
None => from_str(out_filestem).unwrap(),
523520
Some(s) => s,
524521
}
525522
}
@@ -1091,7 +1088,7 @@ fn link_args(sess: &Session,
10911088
// The default library location, we need this to find the runtime.
10921089
// The location of crates will be determined as needed.
10931090
// FIXME (#9639): This needs to handle non-utf8 paths
1094-
let lib_path = sess.target_filesearch().get_lib_path();
1091+
let lib_path = sess.filesearch().get_target_lib_path();
10951092
let stage: ~str = "-L".to_owned() + lib_path.as_str().unwrap();
10961093

10971094
let mut args = vec!(stage);

branches/try2/src/librustc/back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn get_rpath_flags(sess: &Session, out_filename: &Path) -> Vec<~str> {
4040

4141
debug!("preparing the RPATH!");
4242

43-
let sysroot = sess.sysroot();
43+
let sysroot = sess.filesearch().sysroot;
4444
let output = out_filename;
4545
let libs = sess.cstore.get_used_crates(cstore::RequireDynamic);
4646
let libs = libs.move_iter().filter_map(|(_, l)| {

0 commit comments

Comments
 (0)