Skip to content

Commit af76c1d

Browse files
committed
---
yaml --- r: 155518 b: refs/heads/try2 c: d00cf98 h: refs/heads/master v: v3
1 parent 051c53c commit af76c1d

Some content is hidden

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

89 files changed

+1163
-321
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: ae3d42ef0dab39f4d2b36a361f667818e1ffc026
8+
refs/heads/try2: d00cf98ea91280b4ae7d25b6df20baab923af008
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,12 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
453453
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
454454
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
455455

456-
valopt release-channel "source" "the name of the release channel to build"
456+
valopt release-channel "dev" "the name of the release channel to build"
457457

458458
# On windows we just store the libraries in the bin directory because
459459
# there's no rpath. This is where the build system itself puts libraries;
460460
# --libdir is used to configure the installation directory.
461-
# FIXME: Thise needs to parameterized over target triples. Do it in platform.mk
461+
# FIXME: This needs to parameterized over target triples. Do it in platform.mk
462462
CFG_LIBDIR_RELATIVE=lib
463463
if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
464464
then
@@ -479,16 +479,16 @@ validate_opt
479479

480480
# Validate the release channel
481481
case "$CFG_RELEASE_CHANNEL" in
482-
(source | nightly | beta | stable)
482+
(dev | nightly | beta | stable)
483483
;;
484484
(*)
485-
err "release channel must be 'source', 'nightly', 'beta' or 'stable'"
485+
err "release channel must be 'dev', 'nightly', 'beta' or 'stable'"
486486
;;
487487
esac
488488

489489
# Continue supporting the old --enable-nightly flag to transition the bots
490490
# XXX Remove me
491-
if [ $CFG_ENABLE_NIGHTLY -eq 1 ]
491+
if [ ! -z "$CFG_ENABLE_NIGHTLY" ]
492492
then
493493
CFG_RELEASE_CHANNEL=nightly
494494
putvar CFG_RELEASE_CHANNEL

branches/try2/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ DEPS_graphviz := std
7171
DEPS_green := std native:context_switch
7272
DEPS_rustuv := std native:uv native:uv_support
7373
DEPS_native := std
74-
DEPS_syntax := std term serialize log fmt_macros debug arena
74+
DEPS_syntax := std term serialize log fmt_macros debug arena libc
7575
DEPS_rustc := syntax flate arena serialize getopts rbml \
7676
time log graphviz debug rustc_llvm rustc_back
7777
DEPS_rustc_llvm := native:rustllvm libc std

branches/try2/mk/main.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ ifeq ($(CFG_RELEASE_CHANNEL),nightly)
3535
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
3636
CFG_PACKAGE_VERS=nightly
3737
endif
38-
ifeq ($(CFG_RELEASE_CHANNEL),source)
39-
CFG_RELEASE=$(CFG_RELEASE_NUM)-pre
40-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-pre
38+
ifeq ($(CFG_RELEASE_CHANNEL),dev)
39+
CFG_RELEASE=$(CFG_RELEASE_NUM)-dev
40+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-dev
4141
endif
4242

4343
# The name of the package to use for creating tarballs, installers etc.

branches/try2/mk/stage0.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
$(HBIN0_H_$(CFG_BUILD))/:
44
mkdir -p $@
55

6+
# On windows these two are the same, so cause a redifinition warning
7+
ifneq ($(HBIN0_H_$(CFG_BUILD)),$(HLIB0_H_$(CFG_BUILD)))
68
$(HLIB0_H_$(CFG_BUILD))/:
79
mkdir -p $@
10+
endif
811

912
$(SNAPSHOT_RUSTC_POST_CLEANUP): \
1013
$(S)src/snapshots.txt \

branches/try2/src/doc/guide.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ You can create an array with just square brackets:
15071507

15081508
```{rust}
15091509
let nums = [1i, 2i, 3i];
1510+
let nums = [1i, ..20]; // Shorthand for an array of 20 elements all initialized to 1
15101511
```
15111512

15121513
So what's the difference? An array has a fixed size, so you can't add or
@@ -4324,8 +4325,6 @@ and so we tell it that we want a vector of integers.
43244325
is one:
43254326

43264327
```{rust}
4327-
let one_to_one_hundred = range(0i, 100i);
4328-
43294328
let greater_than_forty_two = range(0i, 100i)
43304329
.find(|x| *x >= 42);
43314330

branches/try2/src/etc/pkg/rust.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
SetupIconFile=rust-logo.ico
99
AppName=Rust
1010
AppVersion={#CFG_RELEASE}
11-
AppCopyright=Copyright (C) 2006-2013 Mozilla Foundation, MIT license
11+
AppCopyright=Copyright (C) 2006-2014 Mozilla Foundation, MIT license
1212
AppPublisher=Mozilla Foundation
1313
AppPublisherURL=http://www.rust-lang.org
1414
VersionInfoVersion={#CFG_VERSION_WIN}
@@ -43,7 +43,7 @@ Source: "tmp/dist/win/*.*" ; DestDir: "{app}"; Flags: ignoreversion recursesubdi
4343
[Code]
4444
const
4545
ModPathName = 'modifypath';
46-
ModPathType = 'user';
46+
ModPathType = 'system';
4747
4848
function ModPathDir(): TArrayOfString;
4949
begin

branches/try2/src/liballoc/boxed.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ pub trait BoxAny {
9696
/// `Err(Self)` if it isn't.
9797
#[unstable = "naming conventions around accessing innards may change"]
9898
fn downcast<T: 'static>(self) -> Result<Box<T>, Self>;
99-
100-
/// Deprecated; this method has been renamed to `downcast`.
101-
#[deprecated = "use downcast instead"]
102-
fn move<T: 'static>(self) -> Result<Box<T>, Self> {
103-
self.downcast::<T>()
104-
}
10599
}
106100

107101
#[stable]

branches/try2/src/liballoc/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use core::raw;
1616
#[inline]
1717
#[deprecated]
1818
pub fn get_box_size(body_size: uint, body_align: uint) -> uint {
19-
let header_size = mem::size_of::<raw::Box<()>>();
19+
let header_size = mem::size_of::<raw::GcBox<()>>();
2020
let total_size = align_to(header_size, body_align) + body_size;
2121
total_size
2222
}

branches/try2/src/libcollections/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use core::prelude::*;
1717
use core::fmt;
1818

19-
#[deriving(Clone, PartialEq, Eq, Hash)]
19+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2020
/// A specialized `Set` implementation to use enum types.
2121
pub struct EnumSet<E> {
2222
// We must maintain the invariant that no bits are set

branches/try2/src/libcollections/string.rs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use core::default::Default;
1818
use core::fmt;
1919
use core::mem;
2020
use core::ptr;
21+
use core::ops;
2122
// FIXME: ICE's abound if you import the `Slice` type while importing `Slice` trait
2223
use core::raw::Slice as RawSlice;
2324

@@ -530,7 +531,7 @@ impl String {
530531
/// assert_eq!(s.as_slice(), "abc123");
531532
/// ```
532533
#[inline]
533-
#[stable = "function just renamed from push"]
534+
#[stable = "function just renamed from push_char"]
534535
pub fn push(&mut self, ch: char) {
535536
let cur_len = self.len();
536537
// This may use up to 4 bytes.
@@ -926,6 +927,28 @@ impl<S: Str> Add<S, String> for String {
926927
}
927928
}
928929

930+
impl ops::Slice<uint, str> for String {
931+
#[inline]
932+
fn as_slice_<'a>(&'a self) -> &'a str {
933+
self.as_slice()
934+
}
935+
936+
#[inline]
937+
fn slice_from_<'a>(&'a self, from: &uint) -> &'a str {
938+
self[][*from..]
939+
}
940+
941+
#[inline]
942+
fn slice_to_<'a>(&'a self, to: &uint) -> &'a str {
943+
self[][..*to]
944+
}
945+
946+
#[inline]
947+
fn slice_<'a>(&'a self, from: &uint, to: &uint) -> &'a str {
948+
self[][*from..*to]
949+
}
950+
}
951+
929952
/// Unsafe operations
930953
#[unstable = "waiting on raw module conventions"]
931954
pub mod raw {
@@ -1290,6 +1313,15 @@ mod tests {
12901313
#[test] #[should_fail] fn insert_bad1() { "".to_string().insert(1, 't'); }
12911314
#[test] #[should_fail] fn insert_bad2() { "ệ".to_string().insert(1, 't'); }
12921315

1316+
#[test]
1317+
fn test_slicing() {
1318+
let s = "foobar".to_string();
1319+
assert_eq!("foobar", s[]);
1320+
assert_eq!("foo", s[..3]);
1321+
assert_eq!("bar", s[3..]);
1322+
assert_eq!("oob", s[1..4]);
1323+
}
1324+
12931325
#[bench]
12941326
fn bench_with_capacity(b: &mut Bencher) {
12951327
b.iter(|| {

branches/try2/src/libcore/failure.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
use fmt;
3434
use intrinsics;
3535

36+
// NOTE: remove after next snapshot
37+
#[cfg(stage0)]
38+
pub use self::fail_ as fail;
39+
3640
// NOTE: remove after next snapshot
3741
#[cfg(stage0)]
3842
#[cold] #[inline(never)] // this is the slow path, always
@@ -50,7 +54,7 @@ fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
5054
#[cfg(not(stage0))]
5155
#[cold] #[inline(never)] // this is the slow path, always
5256
#[lang="fail"]
53-
fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
57+
pub fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
5458
let (expr, file, line) = *expr_file_line;
5559
let ref file_line = (file, line);
5660
format_args!(|args| -> () {
@@ -70,11 +74,6 @@ fn fail_bounds_check(file_line: &(&'static str, uint),
7074
unsafe { intrinsics::abort() }
7175
}
7276

73-
#[cold] #[inline(never)]
74-
pub fn fail_str(msg: &str, file: &(&'static str, uint)) -> ! {
75-
format_args!(|fmt| fail_fmt(fmt, file), "{}", msg)
76-
}
77-
7877
#[cold] #[inline(never)]
7978
pub fn fail_fmt(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
8079
#[allow(ctypes)]

branches/try2/src/libcore/iter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ pub trait Iterator<A> {
366366
/// let mut sum = 0;
367367
/// for x in it {
368368
/// if x > 5 {
369-
/// continue;
369+
/// break;
370370
/// }
371371
/// sum += x;
372372
/// }
@@ -377,6 +377,8 @@ pub trait Iterator<A> {
377377
/// sum
378378
/// }
379379
/// let x = vec![1i,2,3,7,8,9];
380+
/// assert_eq!(process(x.into_iter()), 6);
381+
/// let x = vec![1i,2,3];
380382
/// assert_eq!(process(x.into_iter()), 1006);
381383
/// ```
382384
#[inline]

branches/try2/src/libcore/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ macro_rules! fail(
1717
fail!("{}", "explicit failure")
1818
);
1919
($msg:expr) => ({
20-
static _FILE_LINE: (&'static str, uint) = (file!(), line!());
21-
::core::failure::fail_str($msg, &_FILE_LINE)
20+
static _MSG_FILE_LINE: (&'static str, &'static str, uint) = ($msg, file!(), line!());
21+
::core::failure::fail(&_MSG_FILE_LINE)
2222
});
2323
($fmt:expr, $($arg:tt)*) => ({
2424
// a closure can't have return type !, so we need a full

branches/try2/src/libcore/ops.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,13 +764,13 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
764764
// FIXME(#17273) remove the postscript _s
765765
#[lang="slice_mut"]
766766
pub trait SliceMut<Idx, Sized? Result> for Sized? {
767-
/// The method for the slicing operation foo[]
767+
/// The method for the slicing operation foo[mut]
768768
fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Result;
769-
/// The method for the slicing operation foo[from..]
769+
/// The method for the slicing operation foo[mut from..]
770770
fn slice_from_mut_<'a>(&'a mut self, from: &Idx) -> &'a mut Result;
771-
/// The method for the slicing operation foo[..to]
771+
/// The method for the slicing operation foo[mut ..to]
772772
fn slice_to_mut_<'a>(&'a mut self, to: &Idx) -> &'a mut Result;
773-
/// The method for the slicing operation foo[from..to]
773+
/// The method for the slicing operation foo[mut from..to]
774774
fn slice_mut_<'a>(&'a mut self, from: &Idx, to: &Idx) -> &'a mut Result;
775775
}
776776
/**

branches/try2/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl<T> Option<T> {
312312
pub fn expect(self, msg: &str) -> T {
313313
match self {
314314
Some(val) => val,
315-
None => fail!(msg),
315+
None => fail!("{}", msg),
316316
}
317317
}
318318

branches/try2/src/libcore/raw.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
2121
use mem;
2222

23-
/// The representation of a Rust managed box
24-
pub struct Box<T> {
23+
/// The representation of `std::gc::Gc`.
24+
pub struct GcBox<T> {
2525
pub ref_count: uint,
2626
pub drop_glue: fn(ptr: *mut u8),
27-
pub prev: *mut Box<T>,
28-
pub next: *mut Box<T>,
27+
pub prev: *mut GcBox<T>,
28+
pub next: *mut GcBox<T>,
2929
pub data: T,
3030
}
3131

branches/try2/src/libcore/str.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ pub mod traits {
11231123
use collections::Collection;
11241124
use iter::Iterator;
11251125
use option::{Option, Some};
1126+
use ops;
11261127
use str::{Str, StrSlice, eq_slice};
11271128

11281129
impl<'a> Ord for &'a str {
@@ -1162,6 +1163,28 @@ pub mod traits {
11621163
#[inline]
11631164
fn equiv(&self, other: &S) -> bool { eq_slice(*self, other.as_slice()) }
11641165
}
1166+
1167+
impl ops::Slice<uint, str> for str {
1168+
#[inline]
1169+
fn as_slice_<'a>(&'a self) -> &'a str {
1170+
self
1171+
}
1172+
1173+
#[inline]
1174+
fn slice_from_<'a>(&'a self, from: &uint) -> &'a str {
1175+
self.slice_from(*from)
1176+
}
1177+
1178+
#[inline]
1179+
fn slice_to_<'a>(&'a self, to: &uint) -> &'a str {
1180+
self.slice_to(*to)
1181+
}
1182+
1183+
#[inline]
1184+
fn slice_<'a>(&'a self, from: &uint, to: &uint) -> &'a str {
1185+
self.slice(*from, *to)
1186+
}
1187+
}
11651188
}
11661189

11671190
/// Any string that can be represented as a slice

branches/try2/src/libdebug/repr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
277277
fn visit_box(&mut self, mtbl: uint, inner: *const TyDesc) -> bool {
278278
try!(self, self.writer.write("box(GC) ".as_bytes()));
279279
self.write_mut_qualifier(mtbl);
280-
self.get::<&raw::Box<()>>(|this, b| {
280+
self.get::<&raw::GcBox<()>>(|this, b| {
281281
let p = &b.data as *const () as *const u8;
282282
this.visit_ptr_inner(p, inner)
283283
})

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,18 @@ fn add_upstream_rust_crates(cmd: &mut Command, sess: &Session,
13191319
sess.abort_if_errors();
13201320
}
13211321
}
1322+
// Fix up permissions of the copy, as fs::copy() preserves
1323+
// permissions, but the original file may have been installed
1324+
// by a package manager and may be read-only.
1325+
match fs::chmod(&dst, io::UserRead | io::UserWrite) {
1326+
Ok(..) => {}
1327+
Err(e) => {
1328+
sess.err(format!("failed to chmod {} when preparing \
1329+
for LTO: {}", dst.display(),
1330+
e).as_slice());
1331+
sess.abort_if_errors();
1332+
}
1333+
}
13221334
let handler = &sess.diagnostic().handler;
13231335
let config = ArchiveConfig {
13241336
handler: handler,

0 commit comments

Comments
 (0)