Skip to content

Commit b616d84

Browse files
committed
---
yaml --- r: 154877 b: refs/heads/try2 c: d8a2618 h: refs/heads/master i: 154875: b2860cd v: v3
1 parent 5c53c60 commit b616d84

File tree

147 files changed

+7527
-4953
lines changed

Some content is hidden

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

147 files changed

+7527
-4953
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: 9e82fc7ef9b6c8a344dd27583990b02a661af78c
8+
refs/heads/try2: d8a26184dc103025e7ad457ffd8deb391019dbfe
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/runtest.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,10 +1577,6 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
15771577

15781578
// codegen tests (vs. clang)
15791579

1580-
fn make_o_name(config: &Config, testfile: &Path) -> Path {
1581-
output_base_name(config, testfile).with_extension("o")
1582-
}
1583-
15841580
fn append_suffix_to_stem(p: &Path, suffix: &str) -> Path {
15851581
if suffix.len() == 0 {
15861582
(*p).clone()
@@ -1596,14 +1592,13 @@ fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
15961592
// FIXME (#9639): This needs to handle non-utf8 paths
15971593
let link_args = vec!("-L".to_string(),
15981594
aux_dir.as_str().unwrap().to_string());
1599-
let llvm_args = vec!("--emit=obj".to_string(),
1600-
"--crate-type=lib".to_string(),
1601-
"-C".to_string(),
1602-
"save-temps".to_string());
1595+
let llvm_args = vec!("--emit=bc,obj".to_string(),
1596+
"--crate-type=lib".to_string());
16031597
let args = make_compile_args(config,
16041598
props,
16051599
link_args.append(llvm_args.as_slice()),
1606-
|a, b| ThisFile(make_o_name(a, b)), testfile);
1600+
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
1601+
testfile);
16071602
compose_and_run_compiler(config, props, testfile, args, None)
16081603
}
16091604

branches/try2/src/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,8 +2221,8 @@ These types help drive the compiler's analysis
22212221
: This type does not implement "copy", even if eligible
22222222
* `no_send_bound`
22232223
: This type does not implement "send", even if eligible
2224-
* `no_share_bound`
2225-
: This type does not implement "share", even if eligible
2224+
* `no_sync_bound`
2225+
: This type does not implement "sync", even if eligible
22262226
* `eh_personality`
22272227
: ___Needs filling in___
22282228
* `exchange_free`

branches/try2/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 this = "rustdoc";
12+
extern crate "rustdoc" as this;
1313

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

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

branches/try2/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/try2/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/try2/src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ use vec::Vec;
9696
pub use core::slice::{Chunks, Slice, ImmutableSlice, ImmutablePartialEqSlice};
9797
pub use core::slice::{ImmutableOrdSlice, MutableSlice, Items, MutItems};
9898
pub use core::slice::{MutSplits, MutChunks, Splits};
99-
pub use core::slice::{bytes, ref_slice, MutableCloneableSlice};
99+
pub use core::slice::{bytes, mut_ref_slice, ref_slice, MutableCloneableSlice};
100100
pub use core::slice::{Found, NotFound};
101101

102102
// Functional utilities

branches/try2/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/try2/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/try2/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/try2/src/libcore/fmt/mod.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,19 +461,28 @@ impl<'a> Formatter<'a> {
461461
use char::Char;
462462
let align = match self.align {
463463
rt::AlignUnknown => default,
464-
rt::AlignLeft | rt::AlignRight => self.align
464+
_ => self.align
465465
};
466-
if align == rt::AlignLeft {
467-
try!(f(self));
468-
}
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+
469473
let mut fill = [0u8, ..4];
470474
let len = self.fill.encode_utf8(fill).unwrap_or(0);
471-
for _ in range(0, padding) {
475+
476+
for _ in range(0, pre_pad) {
472477
try!(self.buf.write(fill.slice_to(len)));
473478
}
474-
if align == rt::AlignRight {
475-
try!(f(self));
479+
480+
try!(f(self));
481+
482+
for _ in range(0, post_pad) {
483+
try!(self.buf.write(fill.slice_to(len)));
476484
}
485+
477486
Ok(())
478487
}
479488

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ 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,
4648
/// No alignment was requested.
4749
AlignUnknown,
4850
}

branches/try2/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/try2/src/libcore/kinds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ pub mod marker {
271271
/// A type which is considered "not sync", meaning that
272272
/// its contents are not threadsafe, hence they cannot be
273273
/// shared between tasks.
274-
#[lang="no_share_bound"]
274+
#[lang="no_sync_bound"]
275275
#[deriving(PartialEq,Clone)]
276276
pub struct NoSync;
277277

branches/try2/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/try2/src/libfmt_macros/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ 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,
8486
/// The value will take on a default alignment.
8587
AlignUnknown,
8688
}
@@ -279,7 +281,7 @@ impl<'a> Parser<'a> {
279281
match self.cur.clone().next() {
280282
Some((_, c)) => {
281283
match self.cur.clone().skip(1).next() {
282-
Some((_, '>')) | Some((_, '<')) => {
284+
Some((_, '>')) | Some((_, '<')) | Some((_, '^')) => {
283285
spec.fill = Some(c);
284286
self.cur.next();
285287
}
@@ -293,6 +295,8 @@ impl<'a> Parser<'a> {
293295
spec.align = AlignLeft;
294296
} else if self.consume('>') {
295297
spec.align = AlignRight;
298+
} else if self.consume('^') {
299+
spec.align = AlignCenter;
296300
}
297301
// Sign flags
298302
if self.consume('+') {

branches/try2/src/libglob/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ mod test {
680680
}
681681

682682
#[test]
683+
#[ignore(cfg(windows))] // FIXME (#9406)
683684
fn test_lots_of_files() {
684685
// this is a good test because it touches lots of differently named files
685686
glob("/*/*/*/*").skip(10000).next();

branches/try2/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) -> int>,
4545+
errno: c_int) -> c_int>,
45464546
pglob: *mut glob_t);
45474547
pub fn globfree(pglob: *mut glob_t);
45484548
}

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

Lines changed: 12 additions & 24 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 retry(|| unsafe { libc::fstat(self.fd(), &mut stat) }) {
157+
match unsafe { libc::fstat(self.fd(), &mut stat) } {
158158
0 => Ok(mkstat(&stat)),
159159
_ => Err(super::last_error()),
160160
}
@@ -346,9 +346,7 @@ 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(retry(|| unsafe {
350-
libc::mkdir(p.as_ptr(), mode as libc::mode_t)
351-
}))
349+
super::mkerr_libc(unsafe { libc::mkdir(p.as_ptr(), mode as libc::mode_t) })
352350
}
353351

354352
pub fn readdir(p: &CString) -> IoResult<Vec<CString>> {
@@ -393,13 +391,11 @@ pub fn readdir(p: &CString) -> IoResult<Vec<CString>> {
393391
}
394392

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

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

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

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

417411
pub fn chown(p: &CString, uid: int, gid: int) -> IoResult<()> {
@@ -428,10 +422,10 @@ pub fn readlink(p: &CString) -> IoResult<CString> {
428422
len = 1024; // FIXME: read PATH_MAX from C ffi?
429423
}
430424
let mut buf: Vec<u8> = Vec::with_capacity(len as uint);
431-
match retry(|| unsafe {
425+
match unsafe {
432426
libc::readlink(p, buf.as_ptr() as *mut libc::c_char,
433427
len as libc::size_t) as libc::c_int
434-
}) {
428+
} {
435429
-1 => Err(super::last_error()),
436430
n => {
437431
assert!(n > 0);
@@ -442,15 +436,11 @@ pub fn readlink(p: &CString) -> IoResult<CString> {
442436
}
443437

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

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

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

490480
pub fn stat(p: &CString) -> IoResult<rtio::FileStat> {
491481
let mut stat: libc::stat = unsafe { mem::zeroed() };
492-
match retry(|| unsafe { libc::stat(p.as_ptr(), &mut stat) }) {
482+
match unsafe { libc::stat(p.as_ptr(), &mut stat) } {
493483
0 => Ok(mkstat(&stat)),
494484
_ => Err(super::last_error()),
495485
}
496486
}
497487

498488
pub fn lstat(p: &CString) -> IoResult<rtio::FileStat> {
499489
let mut stat: libc::stat = unsafe { mem::zeroed() };
500-
match retry(|| unsafe { libc::lstat(p.as_ptr(), &mut stat) }) {
490+
match unsafe { libc::lstat(p.as_ptr(), &mut stat) } {
501491
0 => Ok(mkstat(&stat)),
502492
_ => Err(super::last_error()),
503493
}
@@ -508,9 +498,7 @@ pub fn utime(p: &CString, atime: u64, mtime: u64) -> IoResult<()> {
508498
actime: (atime / 1000) as libc::time_t,
509499
modtime: (mtime / 1000) as libc::time_t,
510500
};
511-
super::mkerr_libc(retry(|| unsafe {
512-
libc::utime(p.as_ptr(), &buf)
513-
}))
501+
super::mkerr_libc(unsafe { libc::utime(p.as_ptr(), &buf) })
514502
}
515503

516504
#[cfg(test)]

0 commit comments

Comments
 (0)