Skip to content

Commit eacd7fc

Browse files
committed
---
yaml --- r: 130491 b: refs/heads/try c: b7bfe04 h: refs/heads/master i: 130489: 5c9b504 130487: 56a6394 v: v3
1 parent 60978f5 commit eacd7fc

Some content is hidden

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

79 files changed

+563
-614
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: c964cb229bd342bdeb0b4506c3a6d32b03e575f6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 67b97ab6d2b7de9b69fd97dc171fcf8feec932ff
5-
refs/heads/try: bef51ba234a42c52939bcb0f8a5deb7c345d8eba
5+
refs/heads/try: b7bfe04b2d003d08f6ac450f41d7f221cb87f129
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// except according to those terms.
1010

1111
#[cfg(rustdoc)]
12-
extern crate "rustdoc" as this;
12+
extern crate this = "rustdoc";
1313

1414
#[cfg(rustc)]
15-
extern crate "rustc" as this;
15+
extern crate this = "rustc";
1616

1717
fn main() { this::main() }

branches/try/src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub trait Set<T>: Collection {
289289
}
290290

291291
/// A mutable collection of values which are distinct from one another that
292-
/// can be mutaed.
292+
/// can be mutated.
293293
pub trait MutableSet<T>: Set<T> + Mutable {
294294
/// Adds a value to the set. Returns `true` if the value was not already
295295
/// present in the set.

branches/try/src/libcollections/ringbuf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<T> RingBuf<T> {
132132
elts: Vec::from_fn(cmp::max(MINIMUM_CAPACITY, n), |_| None)}
133133
}
134134

135-
/// Retrieva an element in the `RingBuf` by index.
135+
/// Retrieve an element in the `RingBuf` by index.
136136
///
137137
/// Fails if there is no element with the given index.
138138
///

branches/try/src/libcollections/smallintmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl<V:Clone> SmallIntMap<V> {
324324
/// Updates a value in the map. If the key already exists in the map,
325325
/// modifies the value with `ff` taking `oldval, newval`.
326326
/// Otherwise, sets the value to `newval`.
327-
/// Returasn `true` if the key did not already exist in the map.
327+
/// Returns `true` if the key did not already exist in the map.
328328
///
329329
/// # Example
330330
///

branches/try/src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
//!
4545
//! # Representation
4646
//!
47-
//! Rust's string type, `str`, is a sequence of unicode scalar values encoded as a
47+
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as a
4848
//! stream of UTF-8 bytes. All strings are guaranteed to be validly encoded UTF-8
4949
//! sequences. Additionally, strings are not null-terminated and can contain null
5050
//! bytes.

branches/try/src/libcore/char.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub fn escape_unicode(c: char, f: |char|) {
201201
/// - Tab, CR and LF are escaped as '\t', '\r' and '\n' respectively.
202202
/// - Single-quote, double-quote and backslash chars are backslash-escaped.
203203
/// - Any other chars in the range [0x20,0x7e] are not escaped.
204-
/// - Any other chars are given hex unicode escapes; see `escape_unicode`.
204+
/// - Any other chars are given hex Unicode escapes; see `escape_unicode`.
205205
///
206206
pub fn escape_default(c: char, f: |char|) {
207207
match c {
@@ -290,7 +290,7 @@ pub trait Char {
290290
/// * Single-quote, double-quote and backslash chars are backslash-
291291
/// escaped.
292292
/// * Any other chars in the range [0x20,0x7e] are not escaped.
293-
/// * Any other chars are given hex unicode escapes; see `escape_unicode`.
293+
/// * Any other chars are given hex Unicode escapes; see `escape_unicode`.
294294
fn escape_default(&self, f: |char|);
295295

296296
/// Returns the amount of bytes this character would need if encoded in

branches/try/src/libcore/fmt/mod.rs

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -461,28 +461,19 @@ impl<'a> Formatter<'a> {
461461
use char::Char;
462462
let align = match self.align {
463463
rt::AlignUnknown => default,
464-
_ => self.align
464+
rt::AlignLeft | rt::AlignRight => self.align
465465
};
466-
467-
let (pre_pad, post_pad) = match align {
468-
rt::AlignLeft => (0u, padding),
469-
rt::AlignRight | rt::AlignUnknown => (padding, 0u),
470-
rt::AlignCenter => (padding / 2, (padding + 1) / 2),
471-
};
472-
466+
if align == rt::AlignLeft {
467+
try!(f(self));
468+
}
473469
let mut fill = [0u8, ..4];
474470
let len = self.fill.encode_utf8(fill).unwrap_or(0);
475-
476-
for _ in range(0, pre_pad) {
471+
for _ in range(0, padding) {
477472
try!(self.buf.write(fill.slice_to(len)));
478473
}
479-
480-
try!(f(self));
481-
482-
for _ in range(0, post_pad) {
483-
try!(self.buf.write(fill.slice_to(len)));
474+
if align == rt::AlignRight {
475+
try!(f(self));
484476
}
485-
486477
Ok(())
487478
}
488479

branches/try/src/libcore/fmt/rt.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ pub enum Alignment {
4343
AlignLeft,
4444
/// Indication that contents should be right-aligned.
4545
AlignRight,
46-
/// Indication that contents should be center-aligned.
47-
AlignCenter,
4846
/// No alignment was requested.
4947
AlignUnknown,
5048
}

branches/try/src/libcore/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ extern "rust-intrinsic" {
311311

312312
/// Gives the address for the return value of the enclosing function.
313313
///
314-
/// Using this instrinsic in a function that does not use an out pointer
314+
/// Using this intrinsic in a function that does not use an out pointer
315315
/// will trigger a compiler error.
316316
pub fn return_address() -> *const u8;
317317

branches/try/src/libcore/str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ pub trait StrSlice<'a> {
11281128
fn contains_char(&self, needle: char) -> bool;
11291129

11301130
/// An iterator over the characters of `self`. Note, this iterates
1131-
/// over unicode code-points, not unicode graphemes.
1131+
/// over Unicode code-points, not Unicode graphemes.
11321132
///
11331133
/// # Example
11341134
///
@@ -1505,7 +1505,7 @@ pub trait StrSlice<'a> {
15051505
/// Pluck a character out of a string and return the index of the next
15061506
/// character.
15071507
///
1508-
/// This function can be used to iterate over the unicode characters of a
1508+
/// This function can be used to iterate over the Unicode characters of a
15091509
/// string.
15101510
///
15111511
/// # Example
@@ -1549,7 +1549,7 @@ pub trait StrSlice<'a> {
15491549
/// # Return value
15501550
///
15511551
/// A record {ch: char, next: uint} containing the char value and the byte
1552-
/// index of the next unicode character.
1552+
/// index of the next Unicode character.
15531553
///
15541554
/// # Failure
15551555
///
@@ -1559,7 +1559,7 @@ pub trait StrSlice<'a> {
15591559

15601560
/// Given a byte position and a str, return the previous char and its position.
15611561
///
1562-
/// This function can be used to iterate over a unicode string in reverse.
1562+
/// This function can be used to iterate over a Unicode string in reverse.
15631563
///
15641564
/// Returns 0 for next index if called on start index 0.
15651565
///

branches/try/src/libfmt_macros/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ pub enum Alignment {
8181
AlignLeft,
8282
/// The value will be aligned to the right.
8383
AlignRight,
84-
/// The value will be aligned in the center.
85-
AlignCenter,
8684
/// The value will take on a default alignment.
8785
AlignUnknown,
8886
}
@@ -281,7 +279,7 @@ impl<'a> Parser<'a> {
281279
match self.cur.clone().next() {
282280
Some((_, c)) => {
283281
match self.cur.clone().skip(1).next() {
284-
Some((_, '>')) | Some((_, '<')) | Some((_, '^')) => {
282+
Some((_, '>')) | Some((_, '<')) => {
285283
spec.fill = Some(c);
286284
self.cur.next();
287285
}
@@ -295,8 +293,6 @@ impl<'a> Parser<'a> {
295293
spec.align = AlignLeft;
296294
} else if self.consume('>') {
297295
spec.align = AlignRight;
298-
} else if self.consume('^') {
299-
spec.align = AlignCenter;
300296
}
301297
// Sign flags
302298
if self.consume('+') {

branches/try/src/liblibc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* definitions common-to-all (held in modules named c95, c99, posix88, posix01
6666
* and posix08) and definitions that appear only on *some* platforms (named
6767
* 'extra'). This would be things like significant OSX foundation kit, or Windows
68-
* library kernel32.dll, or various fancy glibc, linux or BSD extensions.
68+
* library kernel32.dll, or various fancy glibc, Linux or BSD extensions.
6969
*
7070
* In addition to the per-platform 'extra' modules, we define a module of
7171
* 'common BSD' libc routines that never quite made it into POSIX but show up
@@ -4542,7 +4542,7 @@ pub mod funcs {
45424542
pub fn glob(pattern: *const c_char,
45434543
flags: c_int,
45444544
errfunc: ::Nullable<extern "C" fn(epath: *const c_char,
4545-
errno: c_int) -> c_int>,
4545+
errno: c_int) -> int>,
45464546
pglob: *mut glob_t);
45474547
pub fn globfree(pglob: *mut glob_t);
45484548
}

branches/try/src/libnative/io/file_unix.rs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl rtio::RtioFileStream for FileDesc {
154154

155155
fn fstat(&mut self) -> IoResult<rtio::FileStat> {
156156
let mut stat: libc::stat = unsafe { mem::zeroed() };
157-
match unsafe { libc::fstat(self.fd(), &mut stat) } {
157+
match retry(|| unsafe { libc::fstat(self.fd(), &mut stat) }) {
158158
0 => Ok(mkstat(&stat)),
159159
_ => Err(super::last_error()),
160160
}
@@ -346,7 +346,9 @@ pub fn open(path: &CString, fm: rtio::FileMode, fa: rtio::FileAccess)
346346
}
347347

348348
pub fn mkdir(p: &CString, mode: uint) -> IoResult<()> {
349-
super::mkerr_libc(unsafe { libc::mkdir(p.as_ptr(), mode as libc::mode_t) })
349+
super::mkerr_libc(retry(|| unsafe {
350+
libc::mkdir(p.as_ptr(), mode as libc::mode_t)
351+
}))
350352
}
351353

352354
pub fn readdir(p: &CString) -> IoResult<Vec<CString>> {
@@ -391,11 +393,13 @@ pub fn readdir(p: &CString) -> IoResult<Vec<CString>> {
391393
}
392394

393395
pub fn unlink(p: &CString) -> IoResult<()> {
394-
super::mkerr_libc(unsafe { libc::unlink(p.as_ptr()) })
396+
super::mkerr_libc(retry(|| unsafe { libc::unlink(p.as_ptr()) }))
395397
}
396398

397399
pub fn rename(old: &CString, new: &CString) -> IoResult<()> {
398-
super::mkerr_libc(unsafe { libc::rename(old.as_ptr(), new.as_ptr()) })
400+
super::mkerr_libc(retry(|| unsafe {
401+
libc::rename(old.as_ptr(), new.as_ptr())
402+
}))
399403
}
400404

401405
pub fn chmod(p: &CString, mode: uint) -> IoResult<()> {
@@ -405,7 +409,9 @@ pub fn chmod(p: &CString, mode: uint) -> IoResult<()> {
405409
}
406410

407411
pub fn rmdir(p: &CString) -> IoResult<()> {
408-
super::mkerr_libc(unsafe { libc::rmdir(p.as_ptr()) })
412+
super::mkerr_libc(retry(|| unsafe {
413+
libc::rmdir(p.as_ptr())
414+
}))
409415
}
410416

411417
pub fn chown(p: &CString, uid: int, gid: int) -> IoResult<()> {
@@ -422,10 +428,10 @@ pub fn readlink(p: &CString) -> IoResult<CString> {
422428
len = 1024; // FIXME: read PATH_MAX from C ffi?
423429
}
424430
let mut buf: Vec<u8> = Vec::with_capacity(len as uint);
425-
match unsafe {
431+
match retry(|| unsafe {
426432
libc::readlink(p, buf.as_ptr() as *mut libc::c_char,
427433
len as libc::size_t) as libc::c_int
428-
} {
434+
}) {
429435
-1 => Err(super::last_error()),
430436
n => {
431437
assert!(n > 0);
@@ -436,11 +442,15 @@ pub fn readlink(p: &CString) -> IoResult<CString> {
436442
}
437443

438444
pub fn symlink(src: &CString, dst: &CString) -> IoResult<()> {
439-
super::mkerr_libc(unsafe { libc::symlink(src.as_ptr(), dst.as_ptr()) })
445+
super::mkerr_libc(retry(|| unsafe {
446+
libc::symlink(src.as_ptr(), dst.as_ptr())
447+
}))
440448
}
441449

442450
pub fn link(src: &CString, dst: &CString) -> IoResult<()> {
443-
super::mkerr_libc(unsafe { libc::link(src.as_ptr(), dst.as_ptr()) })
451+
super::mkerr_libc(retry(|| unsafe {
452+
libc::link(src.as_ptr(), dst.as_ptr())
453+
}))
444454
}
445455

446456
fn mkstat(stat: &libc::stat) -> rtio::FileStat {
@@ -479,15 +489,15 @@ fn mkstat(stat: &libc::stat) -> rtio::FileStat {
479489

480490
pub fn stat(p: &CString) -> IoResult<rtio::FileStat> {
481491
let mut stat: libc::stat = unsafe { mem::zeroed() };
482-
match unsafe { libc::stat(p.as_ptr(), &mut stat) } {
492+
match retry(|| unsafe { libc::stat(p.as_ptr(), &mut stat) }) {
483493
0 => Ok(mkstat(&stat)),
484494
_ => Err(super::last_error()),
485495
}
486496
}
487497

488498
pub fn lstat(p: &CString) -> IoResult<rtio::FileStat> {
489499
let mut stat: libc::stat = unsafe { mem::zeroed() };
490-
match unsafe { libc::lstat(p.as_ptr(), &mut stat) } {
500+
match retry(|| unsafe { libc::lstat(p.as_ptr(), &mut stat) }) {
491501
0 => Ok(mkstat(&stat)),
492502
_ => Err(super::last_error()),
493503
}
@@ -498,7 +508,9 @@ pub fn utime(p: &CString, atime: u64, mtime: u64) -> IoResult<()> {
498508
actime: (atime / 1000) as libc::time_t,
499509
modtime: (mtime / 1000) as libc::time_t,
500510
};
501-
super::mkerr_libc(unsafe { libc::utime(p.as_ptr(), &buf) })
511+
super::mkerr_libc(retry(|| unsafe {
512+
libc::utime(p.as_ptr(), &buf)
513+
}))
502514
}
503515

504516
#[cfg(test)]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,8 @@ impl rtio::RtioUdpSocket for UdpSocket {
901901
//
902902
// It turns out that there's this nifty MSG_DONTWAIT flag which can be passed to
903903
// send/recv, but the niftiness wears off once you realize it only works well on
904-
// linux [1] [2]. This means that it's pretty easy to get a nonblocking
905-
// operation on linux (no flag fiddling, no affecting other objects), but not on
904+
// Linux [1] [2]. This means that it's pretty easy to get a nonblocking
905+
// operation on Linux (no flag fiddling, no affecting other objects), but not on
906906
// other platforms.
907907
//
908908
// To work around this constraint on other platforms, we end up using the
@@ -922,7 +922,7 @@ impl rtio::RtioUdpSocket for UdpSocket {
922922
// operations performed in the lock are *nonblocking* to avoid holding the mutex
923923
// forever.
924924
//
925-
// So, in summary, linux uses MSG_DONTWAIT and doesn't need mutexes, everyone
925+
// So, in summary, Linux uses MSG_DONTWAIT and doesn't need mutexes, everyone
926926
// else uses O_NONBLOCK and mutexes with some trickery to make sure blocking
927927
// reads/writes are still blocking.
928928
//

branches/try/src/libnative/io/pipe_windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ impl UnixAcceptor {
655655
// using the original server pipe.
656656
let handle = self.listener.handle;
657657

658-
// If we've had an artifical call to close_accept, be sure to never
658+
// If we've had an artificial call to close_accept, be sure to never
659659
// proceed in accepting new clients in the future
660660
if self.inner.closed.load(atomic::SeqCst) { return Err(util::eof()) }
661661

branches/try/src/libnative/io/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl rtio::RtioProcess for Process {
151151
#[cfg(unix)] use libc::EINVAL as ERROR;
152152
#[cfg(windows)] use libc::ERROR_NOTHING_TO_TERMINATE as ERROR;
153153

154-
// On linux (and possibly other unices), a process that has exited will
154+
// On Linux (and possibly other unices), a process that has exited will
155155
// continue to accept signals because it is "defunct". The delivery of
156156
// signals will only fail once the child has been reaped. For this
157157
// reason, if the process hasn't exited yet, then we attempt to collect

branches/try/src/libnative/io/timer_unix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Timers for non-linux/non-windows OSes
11+
//! Timers for non-Linux/non-Windows OSes
1212
//!
1313
//! This module implements timers with a worker thread, select(), and a lot of
1414
//! witchcraft that turns out to be horribly inaccurate timers. The unfortunate
1515
//! part is that I'm at a loss of what else to do one these OSes. This is also
16-
//! why linux has a specialized timerfd implementation and windows has its own
16+
//! why Linux has a specialized timerfd implementation and windows has its own
1717
//! implementation (they're more accurate than this one).
1818
//!
1919
//! The basic idea is that there is a worker thread that's communicated to via a

branches/try/src/libnative/io/tty_windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! This module contains the implementation of a Windows specific console TTY.
1616
//! Also converts between UTF-16 and UTF-8. Windows has very poor support for
1717
//! UTF-8 and some functions will fail. In particular ReadFile and ReadConsole
18-
//! will fail when the codepage is set to UTF-8 and a unicode character is
18+
//! will fail when the codepage is set to UTF-8 and a Unicode character is
1919
//! entered.
2020
//!
2121
//! FIXME

branches/try/src/libregex/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@
372372
#![deny(missing_doc)]
373373

374374
#[cfg(test)]
375-
extern crate "test" as stdtest;
375+
extern crate stdtest = "test";
376376
#[cfg(test)]
377377
extern crate rand;
378378

@@ -381,7 +381,7 @@ extern crate rand;
381381
#[cfg(test)]
382382
extern crate regex;
383383

384-
// unicode tables for character classes are defined in libunicode
384+
// Unicode tables for character classes are defined in libunicode
385385
extern crate unicode;
386386

387387
pub use parse::Error;

0 commit comments

Comments
 (0)