Skip to content
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

Rollup of 11 pull requests #35125

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9292c0b
Properly feature gate all unstable ABIs
petrochenkov Jul 16, 2016
1afb17e
Fix build of compiler-rt on FreeBSD
asomers Jul 24, 2016
8604c54
Follow-up to 1afb17ed5f9206e1e04c5d72ea724c5fadadd46c
asomers Jul 24, 2016
ccfec65
Update gcc crate dependency to 0.3.27.
timonvo Apr 28, 2016
627d980
Add ARM MUSL targets.
timonvo Apr 28, 2016
28a23d8
arm-musl targets now use cfg(env = "musl")
Jul 26, 2016
925e1df
arm-musl: set max_atomic_width
Jul 27, 2016
e8917ae
arm-musl: statically link to libunwind
Jul 27, 2016
24dc3ce
rustc_back/target: remove musl_base
Jul 27, 2016
132bff9
If a single import resolves to an inaccessible name in some but not a…
jseyfried Jul 25, 2016
8205691
Fix fallout in tests.
jseyfried Jul 26, 2016
fbdf4cb
remove some `any`s that are no longer necessary
Jul 27, 2016
3b955b0
point the libc submodule back to rust-lang/libc
Jul 27, 2016
6ac83de
Add test for string AddAssign
Jul 26, 2016
cfdaca0
Rename _ to {numerics} for unknown numeric types
Jul 27, 2016
cdc6afe
Add non-panicking abs() functions to all signed integer types.
Jul 26, 2016
ea77049
Move to {integer} and {float}
Jul 28, 2016
6dc98cf
Revert "Remove unused methods from MultiSpan"
mcarton Jul 28, 2016
f459e80
Rewrite `collections::LinkedList::append` doc example.
frewsxcv Jul 29, 2016
2a41b31
syntax_ext: format: fix ICE with bad named arguments
xen0n Jul 29, 2016
415fde4
intravisit: Fold functionality of IdVisitor into the regular Visitor.
michaelwoerister Jul 28, 2016
a24de0c
Rollup merge of #34904 - petrochenkov:rustcall, r=nikomatsakis
steveklabnik Jul 30, 2016
47a4be3
Rollup merge of #35004 - asomers:master, r=alexcrichton
steveklabnik Jul 30, 2016
bb01409
Rollup merge of #35049 - knight42:add-test, r=alexcrichton
steveklabnik Jul 30, 2016
2aa30ae
Rollup merge of #35058 - jethrogb:no_panic_abs, r=alexcrichton
steveklabnik Jul 30, 2016
2f66365
Rollup merge of #35060 - japaric:arm-musl, r=alexcrichton
steveklabnik Jul 30, 2016
7912e2b
Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names…
steveklabnik Jul 30, 2016
a6c519b
Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, …
steveklabnik Jul 30, 2016
8d6f9ae
Rollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddyb
steveklabnik Jul 30, 2016
09689b9
Rollup merge of #35094 - mcarton:multispan, r=jonathandturner
steveklabnik Jul 30, 2016
36782a7
Rollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnik
steveklabnik Jul 30, 2016
638c353
Rollup merge of #35106 - xen0n:issue-35082, r=alexcrichton
steveklabnik Jul 30, 2016
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
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ do
;;


x86_64-*-musl)
x86_64-*-musl | arm-*-musleabi)
if [ ! -f $CFG_MUSL_ROOT/lib/libc.a ]
then
err "musl libc $CFG_MUSL_ROOT/lib/libc.a not found"
Expand Down
3 changes: 3 additions & 0 deletions mk/cfg/arm-unknown-linux-musleabi.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is intentially left empty to indicate that, while this target is
# supported, it's not supported using plain GNU Make builds. Use a --rustbuild
# instead.
3 changes: 3 additions & 0 deletions mk/cfg/arm-unknown-linux-musleabihf.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is intentially left empty to indicate that, while this target is
# supported, it's not supported using plain GNU Make builds. Use a --rustbuild
# instead.
3 changes: 3 additions & 0 deletions mk/cfg/armv7-unknown-linux-musleabihf.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is intentially left empty to indicate that, while this target is
# supported, it's not supported using plain GNU Make builds. Use a --rustbuild
# instead.
4 changes: 4 additions & 0 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ COMPRT_OBJS_$(1) += emutls.o
endif

ifeq ($$(findstring msvc,$(1)),)

ifeq ($$(findstring freebsd,$(1)),)
COMPRT_OBJS_$(1) += gcc_personality_v0.o
endif

COMPRT_OBJS_$(1) += emutls.o

ifeq ($$(findstring x86_64,$(1)),x86_64)
Expand Down
12 changes: 6 additions & 6 deletions src/bootstrap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ pub fn std_link(build: &Build,
}
add_to_sysroot(&out_dir, &libdir);

if target.contains("musl") &&
(target.contains("x86_64") || target.contains("i686")) {
if target.contains("musl") && !target.contains("mips") {
copy_third_party_objects(build, target, &libdir);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ pub fn compiler_rt(build: &Build, target: &str) {
]);
}
} else {
sources.push("gcc_personality_v0.c");
if !target.contains("freebsd") {
sources.push("gcc_personality_v0.c");
}

if target.contains("x86_64") {
sources.extend(vec![
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn check(build: &mut Build) {
}

// Make sure musl-root is valid if specified
if target.contains("musl") && (target.contains("x86_64") || target.contains("i686")) {
if target.contains("musl") && !target.contains("mips") {
match build.config.musl_root {
Some(ref root) => {
if fs::metadata(root.join("lib/libc.a")).is_err() {
Expand Down
1 change: 1 addition & 0 deletions src/doc/book/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ trait system to overload operators. Calling functions is no different. We have
three separate traits to overload with:

```rust
# #![feature(unboxed_closures)]
# mod foo {
pub trait Fn<Args> : FnMut<Args> {
extern "rust-call" fn call(&self, args: Args) -> Self::Output;
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc_jemalloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ libc = { path = "../rustc/libc_shim" }

[build-dependencies]
build_helper = { path = "../build_helper" }
gcc = "0.3.17"
gcc = "0.3.27"

[features]
debug = []
11 changes: 10 additions & 1 deletion src/liballoc_jemalloc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ fn main() {
.replace("\\", "/"))
.current_dir(&build_dir)
.env("CC", compiler.path())
.env("EXTRA_CFLAGS", cflags)
.env("EXTRA_CFLAGS", cflags.clone())
// jemalloc generates Makefile deps using GCC's "-MM" flag. This means
// that GCC will run the preprocessor, and only the preprocessor, over
// jemalloc's source files. If we don't specify CPPFLAGS, then at least
// on ARM that step fails with a "Missing implementation for 32-bit
// atomic operations" error. This is because no "-march" flag will be
// passed to GCC, and then GCC won't define the
// "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" macro that jemalloc needs to
// select an atomic operation implementation.
.env("CPPFLAGS", cflags.clone())
.env("AR", &ar)
.env("RANLIB", format!("{} s", ar.display()));

Expand Down
25 changes: 14 additions & 11 deletions src/libcollections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,22 @@ impl<T> LinkedList<T> {
/// ```
/// use std::collections::LinkedList;
///
/// let mut a = LinkedList::new();
/// let mut b = LinkedList::new();
/// a.push_back(1);
/// a.push_back(2);
/// b.push_back(3);
/// b.push_back(4);
/// let mut list1 = LinkedList::new();
/// list1.push_back('a');
///
/// a.append(&mut b);
/// let mut list2 = LinkedList::new();
/// list2.push_back('b');
/// list2.push_back('c');
///
/// for e in &a {
/// println!("{}", e); // prints 1, then 2, then 3, then 4
/// }
/// println!("{}", b.len()); // prints 0
/// list1.append(&mut list2);
///
/// let mut iter = list1.iter();
/// assert_eq!(iter.next(), Some(&'a'));
/// assert_eq!(iter.next(), Some(&'b'));
/// assert_eq!(iter.next(), Some(&'c'));
/// assert!(iter.next().is_none());
///
/// assert!(list2.is_empty());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn append(&mut self, other: &mut Self) {
Expand Down
11 changes: 11 additions & 0 deletions src/libcollectionstest/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ fn test_push_str() {
assert_eq!(&s[0..], "abcประเทศไทย中华Việt Nam");
}

#[test]
fn test_add_assign() {
let mut s = String::new();
s += "";
assert_eq!(s.as_str(), "");
s += "abc";
assert_eq!(s.as_str(), "abc");
s += "ประเทศไทย中华Việt Nam";
assert_eq!(s.as_str(), "abcประเทศไทย中华Việt Nam");
}

#[test]
fn test_push() {
let mut data = String::from("ประเทศไทย中");
Expand Down
84 changes: 84 additions & 0 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,31 @@ macro_rules! int_impl {
if b {None} else {Some(a)}
}

/// Checked absolute value. Computes `self.abs()`, returning `None` if
/// `self == MIN`.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// # #![feature(no_panic_abs)]
///
/// use std::i32;
///
/// assert_eq!((-5i32).checked_abs(), Some(5));
/// assert_eq!(i32::MIN.checked_abs(), None);
/// ```
#[unstable(feature = "no_panic_abs", issue = "35057")]
#[inline]
pub fn checked_abs(self) -> Option<Self> {
if self.is_negative() {
self.checked_neg()
} else {
Some(self)
}
}

/// Saturating integer addition. Computes `self + other`, saturating at
/// the numeric bounds instead of overflowing.
///
Expand Down Expand Up @@ -863,6 +888,36 @@ macro_rules! int_impl {
self.overflowing_shr(rhs).0
}

/// Wrapping (modular) absolute value. Computes `self.abs()`,
/// wrapping around at the boundary of the type.
///
/// The only case where such wrapping can occur is when one takes
/// the absolute value of the negative minimal value for the type
/// this is a positive value that is too large to represent in the
/// type. In such a case, this function returns `MIN` itself.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// # #![feature(no_panic_abs)]
///
/// assert_eq!(100i8.wrapping_abs(), 100);
/// assert_eq!((-100i8).wrapping_abs(), 100);
/// assert_eq!((-128i8).wrapping_abs(), -128);
/// assert_eq!((-128i8).wrapping_abs() as u8, 128);
/// ```
#[unstable(feature = "no_panic_abs", issue = "35057")]
#[inline(always)]
pub fn wrapping_abs(self) -> Self {
if self.is_negative() {
self.wrapping_neg()
} else {
self
}
}

/// Calculates `self` + `rhs`
///
/// Returns a tuple of the addition along with a boolean indicating
Expand Down Expand Up @@ -1071,6 +1126,35 @@ macro_rules! int_impl {
(self >> (rhs & ($BITS - 1)), (rhs > ($BITS - 1)))
}

/// Computes the absolute value of `self`.
///
/// Returns a tuple of the absolute version of self along with a
/// boolean indicating whether an overflow happened. If self is the
/// minimum value (e.g. i32::MIN for values of type i32), then the
/// minimum value will be returned again and true will be returned for
/// an overflow happening.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// # #![feature(no_panic_abs)]
///
/// assert_eq!(10i8.overflowing_abs(), (10,false));
/// assert_eq!((-10i8).overflowing_abs(), (10,false));
/// assert_eq!((-128i8).overflowing_abs(), (-128,true));
/// ```
#[unstable(feature = "no_panic_abs", issue = "35057")]
#[inline]
pub fn overflowing_abs(self) -> (Self, bool) {
if self.is_negative() {
self.overflowing_neg()
} else {
(self, false)
}
}

/// Raises self to the power of `exp`, using exponentiation by squaring.
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion src/libflate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ crate-type = ["dylib"]

[build-dependencies]
build_helper = { path = "../build_helper" }
gcc = "0.3"
gcc = "0.3.27"
Loading