Skip to content

Rolling up PRs in the queue #17629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3c47d89
Remove unnecessary code from an example
MatejLach Sep 24, 2014
b5c17b3
Use 'dev' for the release channel and version suffix when building fr…
brson Sep 25, 2014
29424ee
fix a misspelling in the configure script
eklitzke Sep 25, 2014
c2f8db1
Added bitflag toggling.
Sep 26, 2014
a4844a6
Fix Iterator::fuse example
sfackler Sep 26, 2014
2257e23
librustc: Eliminate the `ref` syntax for unboxed closure capture clauses
pcwalton Sep 24, 2014
f57e9d0
Fix `SliceMut` documentation
Sep 26, 2014
8a56126
tiny linguistic correction in docs: s/its'/its/
akavel Sep 26, 2014
35f5a67
dist: Make Windows installer modify system %PATH%
iliekturtles Sep 26, 2014
fc1b908
Hide the quote_*! macros when the feature gate is off
kmcallister Sep 27, 2014
070ba14
Correct stability marker in string.rs
squeaky-pl Sep 27, 2014
f8a180b
Rename raw::Box to raw::GcBox
kmcallister Sep 27, 2014
aa2814f
Implement Slice for String and str
sfackler Sep 27, 2014
b39921c
Add test for #16465
Sawyer47 Sep 27, 2014
9d60de9
Translate inline assembly errors back to source locations
kmcallister Sep 27, 2014
e27308b
make EnumSet derive Ord and PartialOrd
Gankra Sep 27, 2014
3b9732e
Defailbloat fail!(&'static str)
Tobba Sep 28, 2014
8826fdf
Keep ExpnId abstract by providing conversions
kmcallister Sep 28, 2014
cab84be
Correctly populate trait impl map when checking for impl overlaps
bkoropoff Sep 28, 2014
2c589df
Test for `..` in range patterns
nrc Sep 24, 2014
ca15637
Reject casts to unsized types and suggest use of reference or box
bkoropoff Sep 27, 2014
69d570f
Add regression test for issue #17441
bkoropoff Sep 27, 2014
fa419d3
Register new snapshots
sfackler Sep 29, 2014
ae3d42e
Use the same JSON schema for encoding enums in PrettyEncoder as in En…
bkoropoff Sep 29, 2014
9cc3663
Update ANTLR float suffix grammar
Boddlnagg Sep 29, 2014
991f506
rustc: Fix permission denied error in 'ar' when lto is enabled
wizeman Sep 27, 2014
54831f1
rustdoc: Render where clauses as appropriate
tomjakubowski Sep 25, 2014
1ebf456
rollup merge of #17510 : MatejLach/find_fix
alexcrichton Sep 29, 2014
655b726
rollup merge of #17519 : pcwalton/unboxed-closure-move-syntax
alexcrichton Sep 29, 2014
6c23789
rollup merge of #17531 : tomjakubowski/rustdoc-where-clauses
alexcrichton Sep 29, 2014
01c25e6
rollup merge of #17542 : brson/devchannel
alexcrichton Sep 29, 2014
5fae40c
rollup merge of #17548 : cgaebel/master
alexcrichton Sep 29, 2014
94c1b1f
rollup merge of #17544 : eklitzke/master
alexcrichton Sep 29, 2014
e786891
rollup merge of #17557 : sfackler/fuse-example
alexcrichton Sep 29, 2014
bb84afe
rollup merge of #17564 : japaric/fix-slicemut-docs
alexcrichton Sep 29, 2014
00009f9
rollup merge of #17565 : akavel/patch-1
alexcrichton Sep 29, 2014
757fa6f
rollup merge of #17573 : iliekturtles/17570-windows-installer-path
alexcrichton Sep 29, 2014
792e32b
rollup merge of #17576 : kmcallister/hide-quotes
alexcrichton Sep 29, 2014
55754ed
rollup merge of #17577 : squeaky-pl/patch-1
alexcrichton Sep 29, 2014
e44393a
rollup merge of #17582 : kmcallister/gc-box
alexcrichton Sep 29, 2014
735d16b
rollup merge of #17585 : sfackler/string-slice
alexcrichton Sep 29, 2014
b7c002a
rollup merge of #17586 : Sawyer47/test-16465
alexcrichton Sep 29, 2014
7784a8d
rollup merge of #17592 : kmcallister/inline-asm-loc
alexcrichton Sep 29, 2014
0358f31
rollup merge of #17598 : bkoropoff/issue-17441
alexcrichton Sep 29, 2014
86b1e6f
rollup merge of #17599 : Gankro/enum-ord
alexcrichton Sep 29, 2014
ea3a3e9
rollup merge of #17602 : Tobba/defailbloat-static
alexcrichton Sep 29, 2014
29216b5
rollup merge of #17613 : bkoropoff/issue-17593
alexcrichton Sep 29, 2014
915511e
rollup merge of #17614 : nick29581/slice3
alexcrichton Sep 29, 2014
1a18258
rollup merge of #17619 : wizeman/fix-perm
alexcrichton Sep 29, 2014
d00cf98
rollup merge of #17623 : bkoropoff/issue-17607
alexcrichton Sep 29, 2014
dfbf32f
rollup merge of #17625 : Boddlnagg/lexer-fix
alexcrichton Sep 29, 2014
1ae44c2
rollup merge of #17621 : sfackler/new-snap
alexcrichton Sep 29, 2014
d3e1718
Test fixes from the rollup
alexcrichton Sep 29, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"

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

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

# Validate the release channel
case "$CFG_RELEASE_CHANNEL" in
(source | nightly | beta | stable)
(dev | nightly | beta | stable)
;;
(*)
err "release channel must be 'source', 'nightly', 'beta' or 'stable'"
err "release channel must be 'dev', 'nightly', 'beta' or 'stable'"
;;
esac

Expand Down
2 changes: 1 addition & 1 deletion mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ DEPS_graphviz := std
DEPS_green := std native:context_switch
DEPS_rustuv := std native:uv native:uv_support
DEPS_native := std
DEPS_syntax := std term serialize log fmt_macros debug arena
DEPS_syntax := std term serialize log fmt_macros debug arena libc
DEPS_rustc := syntax flate arena serialize getopts rbml \
time log graphviz debug rustc_llvm rustc_back
DEPS_rustc_llvm := native:rustllvm libc std
Expand Down
6 changes: 3 additions & 3 deletions mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ ifeq ($(CFG_RELEASE_CHANNEL),nightly)
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
CFG_PACKAGE_VERS=nightly
endif
ifeq ($(CFG_RELEASE_CHANNEL),source)
CFG_RELEASE=$(CFG_RELEASE_NUM)-pre
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-pre
ifeq ($(CFG_RELEASE_CHANNEL),dev)
CFG_RELEASE=$(CFG_RELEASE_NUM)-dev
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-dev
endif

# The name of the package to use for creating tarballs, installers etc.
Expand Down
2 changes: 0 additions & 2 deletions src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4325,8 +4325,6 @@ and so we tell it that we want a vector of integers.
is one:

```{rust}
let one_to_one_hundred = range(0i, 100i);

let greater_than_forty_two = range(0i, 100i)
.find(|x| *x >= 42);

Expand Down
4 changes: 2 additions & 2 deletions src/etc/pkg/rust.iss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SetupIconFile=rust-logo.ico
AppName=Rust
AppVersion={#CFG_RELEASE}
AppCopyright=Copyright (C) 2006-2013 Mozilla Foundation, MIT license
AppCopyright=Copyright (C) 2006-2014 Mozilla Foundation, MIT license
AppPublisher=Mozilla Foundation
AppPublisherURL=http://www.rust-lang.org
VersionInfoVersion={#CFG_VERSION_WIN}
Expand Down Expand Up @@ -43,7 +43,7 @@ Source: "tmp/dist/win/*.*" ; DestDir: "{app}"; Flags: ignoreversion recursesubdi
[Code]
const
ModPathName = 'modifypath';
ModPathType = 'user';
ModPathType = 'system';

function ModPathDir(): TArrayOfString;
begin
Expand Down
3 changes: 1 addition & 2 deletions src/grammar/RustLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ LIT_INTEGER
| '0x' [0-9a-fA-F][0-9a-fA-F_]* INT_SUFFIX?
;

FLOAT_SUFFIX
fragment FLOAT_SUFFIX
: 'f32'
| 'f64'
| 'f128'
;

LIT_FLOAT
Expand Down
6 changes: 0 additions & 6 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ pub trait BoxAny {
/// `Err(Self)` if it isn't.
#[unstable = "naming conventions around accessing innards may change"]
fn downcast<T: 'static>(self) -> Result<Box<T>, Self>;

/// Deprecated; this method has been renamed to `downcast`.
#[deprecated = "use downcast instead"]
fn move<T: 'static>(self) -> Result<Box<T>, Self> {
self.downcast::<T>()
}
}

#[stable]
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use core::raw;
#[inline]
#[deprecated]
pub fn get_box_size(body_size: uint, body_align: uint) -> uint {
let header_size = mem::size_of::<raw::Box<()>>();
let header_size = mem::size_of::<raw::GcBox<()>>();
let total_size = align_to(header_size, body_align) + body_size;
total_size
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use core::prelude::*;
use core::fmt;

#[deriving(Clone, PartialEq, Eq, Hash)]
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
/// A specialized `Set` implementation to use enum types.
pub struct EnumSet<E> {
// We must maintain the invariant that no bits are set
Expand Down
34 changes: 33 additions & 1 deletion src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use core::default::Default;
use core::fmt;
use core::mem;
use core::ptr;
use core::ops;
// FIXME: ICE's abound if you import the `Slice` type while importing `Slice` trait
use core::raw::Slice as RawSlice;

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

impl ops::Slice<uint, str> for String {
#[inline]
fn as_slice_<'a>(&'a self) -> &'a str {
self.as_slice()
}

#[inline]
fn slice_from_<'a>(&'a self, from: &uint) -> &'a str {
self[][*from..]
}

#[inline]
fn slice_to_<'a>(&'a self, to: &uint) -> &'a str {
self[][..*to]
}

#[inline]
fn slice_<'a>(&'a self, from: &uint, to: &uint) -> &'a str {
self[][*from..*to]
}
}

/// Unsafe operations
#[unstable = "waiting on raw module conventions"]
pub mod raw {
Expand Down Expand Up @@ -1290,6 +1313,15 @@ mod tests {
#[test] #[should_fail] fn insert_bad1() { "".to_string().insert(1, 't'); }
#[test] #[should_fail] fn insert_bad2() { "ệ".to_string().insert(1, 't'); }

#[test]
fn test_slicing() {
let s = "foobar".to_string();
assert_eq!("foobar", s[]);
assert_eq!("foo", s[..3]);
assert_eq!("bar", s[3..]);
assert_eq!("oob", s[1..4]);
}

#[bench]
fn bench_with_capacity(b: &mut Bencher) {
b.iter(|| {
Expand Down
3 changes: 0 additions & 3 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2393,8 +2393,6 @@ mod tests {
let _ = vec[3];
}

// NOTE uncomment after snapshot
/*
#[test]
#[should_fail]
fn test_slice_out_of_bounds_1() {
Expand Down Expand Up @@ -2429,7 +2427,6 @@ mod tests {
let x: Vec<int> = vec![1, 2, 3, 4, 5];
x[3..2];
}
*/

#[test]
fn test_swap_remove_empty() {
Expand Down
30 changes: 1 addition & 29 deletions src/libcore/failure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,9 @@
use fmt;
use intrinsics;

// NOTE: remove after next snapshot
#[cfg(stage0)]
#[cold] #[inline(never)] // this is the slow path, always
#[lang="fail_"]
fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
let (expr, file, line) = *expr_file_line;
let ref file_line = (file, line);
format_args!(|args| -> () {
fail_fmt(args, file_line);
}, "{}", expr);

unsafe { intrinsics::abort() }
}

#[cfg(not(stage0))]
#[cold] #[inline(never)] // this is the slow path, always
#[lang="fail"]
fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
pub fn fail(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
let (expr, file, line) = *expr_file_line;
let ref file_line = (file, line);
format_args!(|args| -> () {
Expand All @@ -70,23 +55,10 @@ fn fail_bounds_check(file_line: &(&'static str, uint),
unsafe { intrinsics::abort() }
}

#[cold] #[inline(never)]
pub fn fail_str(msg: &str, file: &(&'static str, uint)) -> ! {
format_args!(|fmt| fail_fmt(fmt, file), "{}", msg)
}

#[cold] #[inline(never)]
pub fn fail_fmt(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
#[allow(ctypes)]
extern {

// NOTE: remove after next snapshot
#[cfg(stage0)]
#[lang = "begin_unwind"]
fn fail_impl(fmt: &fmt::Arguments, file: &'static str,
line: uint) -> !;

#[cfg(not(stage0))]
#[lang = "fail_fmt"]
fn fail_impl(fmt: &fmt::Arguments, file: &'static str,
line: uint) -> !;
Expand Down
4 changes: 3 additions & 1 deletion src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ pub trait Iterator<A> {
/// let mut sum = 0;
/// for x in it {
/// if x > 5 {
/// continue;
/// break;
/// }
/// sum += x;
/// }
Expand All @@ -377,6 +377,8 @@ pub trait Iterator<A> {
/// sum
/// }
/// let x = vec![1i,2,3,7,8,9];
/// assert_eq!(process(x.into_iter()), 6);
/// let x = vec![1i,2,3];
/// assert_eq!(process(x.into_iter()), 1006);
/// ```
#[inline]
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ macro_rules! fail(
fail!("{}", "explicit failure")
);
($msg:expr) => ({
static _FILE_LINE: (&'static str, uint) = (file!(), line!());
::core::failure::fail_str($msg, &_FILE_LINE)
static _MSG_FILE_LINE: (&'static str, &'static str, uint) = ($msg, file!(), line!());
::core::failure::fail(&_MSG_FILE_LINE)
});
($fmt:expr, $($arg:tt)*) => ({
// a closure can't have return type !, so we need a full
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,13 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
// FIXME(#17273) remove the postscript _s
#[lang="slice_mut"]
pub trait SliceMut<Idx, Sized? Result> for Sized? {
/// The method for the slicing operation foo[]
/// The method for the slicing operation foo[mut]
fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Result;
/// The method for the slicing operation foo[from..]
/// The method for the slicing operation foo[mut from..]
fn slice_from_mut_<'a>(&'a mut self, from: &Idx) -> &'a mut Result;
/// The method for the slicing operation foo[..to]
/// The method for the slicing operation foo[mut ..to]
fn slice_to_mut_<'a>(&'a mut self, to: &Idx) -> &'a mut Result;
/// The method for the slicing operation foo[from..to]
/// The method for the slicing operation foo[mut from..to]
fn slice_mut_<'a>(&'a mut self, from: &Idx, to: &Idx) -> &'a mut Result;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl<T> Option<T> {
pub fn expect(self, msg: &str) -> T {
match self {
Some(val) => val,
None => fail!(msg),
None => fail!("{}", msg),
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/libcore/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

use mem;

/// The representation of a Rust managed box
pub struct Box<T> {
/// The representation of `std::gc::Gc`.
pub struct GcBox<T> {
pub ref_count: uint,
pub drop_glue: fn(ptr: *mut u8),
pub prev: *mut Box<T>,
pub next: *mut Box<T>,
pub prev: *mut GcBox<T>,
pub next: *mut GcBox<T>,
pub data: T,
}

Expand Down
23 changes: 23 additions & 0 deletions src/libcore/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ pub mod traits {
use collections::Collection;
use iter::Iterator;
use option::{Option, Some};
use ops;
use str::{Str, StrSlice, eq_slice};

impl<'a> Ord for &'a str {
Expand Down Expand Up @@ -1162,6 +1163,28 @@ pub mod traits {
#[inline]
fn equiv(&self, other: &S) -> bool { eq_slice(*self, other.as_slice()) }
}

impl ops::Slice<uint, str> for str {
#[inline]
fn as_slice_<'a>(&'a self) -> &'a str {
self
}

#[inline]
fn slice_from_<'a>(&'a self, from: &uint) -> &'a str {
self.slice_from(*from)
}

#[inline]
fn slice_to_<'a>(&'a self, to: &uint) -> &'a str {
self.slice_to(*to)
}

#[inline]
fn slice_<'a>(&'a self, from: &uint, to: &uint) -> &'a str {
self.slice(*from, *to)
}
}
}

/// Any string that can be represented as a slice
Expand Down
2 changes: 1 addition & 1 deletion src/libdebug/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
fn visit_box(&mut self, mtbl: uint, inner: *const TyDesc) -> bool {
try!(self, self.writer.write("box(GC) ".as_bytes()));
self.write_mut_qualifier(mtbl);
self.get::<&raw::Box<()>>(|this, b| {
self.get::<&raw::GcBox<()>>(|this, b| {
let p = &b.data as *const () as *const u8;
this.visit_ptr_inner(p, inner)
})
Expand Down
12 changes: 12 additions & 0 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,18 @@ fn add_upstream_rust_crates(cmd: &mut Command, sess: &Session,
sess.abort_if_errors();
}
}
// Fix up permissions of the copy, as fs::copy() preserves
// permissions, but the original file may have been installed
// by a package manager and may be read-only.
match fs::chmod(&dst, io::UserRead | io::UserWrite) {
Ok(..) => {}
Err(e) => {
sess.err(format!("failed to chmod {} when preparing \
for LTO: {}", dst.display(),
e).as_slice());
sess.abort_if_errors();
}
}
let handler = &sess.diagnostic().handler;
let config = ArchiveConfig {
handler: handler,
Expand Down
Loading