Skip to content

Commit 1f3cda8

Browse files
committed
auto merge of #17629 : alexcrichton/rust/rollup, r=alexcrichton
2 parents 5079a10 + d3e1718 commit 1f3cda8

Some content is hidden

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

74 files changed

+727
-279
lines changed

configure

+4-4
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,10 +479,10 @@ 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

mk/crates.mk

+1-1
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

mk/main.mk

+3-3
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.

src/doc/guide.md

-2
Original file line numberDiff line numberDiff line change
@@ -4325,8 +4325,6 @@ and so we tell it that we want a vector of integers.
43254325
is one:
43264326

43274327
```{rust}
4328-
let one_to_one_hundred = range(0i, 100i);
4329-
43304328
let greater_than_forty_two = range(0i, 100i)
43314329
.find(|x| *x >= 42);
43324330

src/etc/pkg/rust.iss

+2-2
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

src/grammar/RustLexer.g4

+1-2
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,9 @@ LIT_INTEGER
120120
| '0x' [0-9a-fA-F][0-9a-fA-F_]* INT_SUFFIX?
121121
;
122122

123-
FLOAT_SUFFIX
123+
fragment FLOAT_SUFFIX
124124
: 'f32'
125125
| 'f64'
126-
| 'f128'
127126
;
128127

129128
LIT_FLOAT

src/liballoc/boxed.rs

-6
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]

src/liballoc/util.rs

+1-1
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
}

src/libcollections/enum_set.rs

+1-1
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

src/libcollections/string.rs

+33-1
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(|| {

src/libcollections/vec.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2393,8 +2393,6 @@ mod tests {
23932393
let _ = vec[3];
23942394
}
23952395

2396-
// NOTE uncomment after snapshot
2397-
/*
23982396
#[test]
23992397
#[should_fail]
24002398
fn test_slice_out_of_bounds_1() {
@@ -2429,7 +2427,6 @@ mod tests {
24292427
let x: Vec<int> = vec![1, 2, 3, 4, 5];
24302428
x[3..2];
24312429
}
2432-
*/
24332430

24342431
#[test]
24352432
fn test_swap_remove_empty() {

src/libcore/failure.rs

+1-29
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,9 @@
3333
use fmt;
3434
use intrinsics;
3535

36-
// NOTE: remove after next snapshot
37-
#[cfg(stage0)]
38-
#[cold] #[inline(never)] // this is the slow path, always
39-
#[lang="fail_"]
40-
fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
41-
let (expr, file, line) = *expr_file_line;
42-
let ref file_line = (file, line);
43-
format_args!(|args| -> () {
44-
fail_fmt(args, file_line);
45-
}, "{}", expr);
46-
47-
unsafe { intrinsics::abort() }
48-
}
49-
50-
#[cfg(not(stage0))]
5136
#[cold] #[inline(never)] // this is the slow path, always
5237
#[lang="fail"]
53-
fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
38+
pub fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
5439
let (expr, file, line) = *expr_file_line;
5540
let ref file_line = (file, line);
5641
format_args!(|args| -> () {
@@ -70,23 +55,10 @@ fn fail_bounds_check(file_line: &(&'static str, uint),
7055
unsafe { intrinsics::abort() }
7156
}
7257

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-
7858
#[cold] #[inline(never)]
7959
pub fn fail_fmt(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
8060
#[allow(ctypes)]
8161
extern {
82-
83-
// NOTE: remove after next snapshot
84-
#[cfg(stage0)]
85-
#[lang = "begin_unwind"]
86-
fn fail_impl(fmt: &fmt::Arguments, file: &'static str,
87-
line: uint) -> !;
88-
89-
#[cfg(not(stage0))]
9062
#[lang = "fail_fmt"]
9163
fn fail_impl(fmt: &fmt::Arguments, file: &'static str,
9264
line: uint) -> !;

src/libcore/iter.rs

+3-1
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]

src/libcore/macros.rs

+2-2
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

src/libcore/ops.rs

+4-4
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
/**

src/libcore/option.rs

+1-1
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

src/libcore/raw.rs

+4-4
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

src/libcore/str.rs

+23
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

src/libdebug/repr.rs

+1-1
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
})

src/librustc/back/link.rs

+12
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)