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 12 pull requests #40618

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
460bf55
Cleanup.
jseyfried Mar 6, 2017
68c1cc6
Refactor `Attribute` to use `Path` and `TokenStream` instead of `Meta…
jseyfried Mar 3, 2017
839c286
Liberalize attributes.
jseyfried Mar 8, 2017
85e02bd
Add tests.
jseyfried Mar 8, 2017
5fab9bf
travis: Ensure cargo links libcurl statically
alexcrichton Mar 14, 2017
61d9387
Target builds for older macOS
wagenet Mar 13, 2017
cc23d17
make shift builtins panic-free with new unchecked_sh* intrinsics
TimNN Mar 14, 2017
2561dcd
Rename TryFrom's associated type and implement str::parse using TryFrom.
jimmycuadra Mar 5, 2017
9b89274
Fix const not displayed in rustdoc
GuillaumeGomez Mar 16, 2017
449219a
isolate llvm 4.0 code path
TimNN Mar 16, 2017
222ca3c
clang-format
TimNN Mar 16, 2017
95bd7f2
add missing global metadata
TimNN Mar 16, 2017
50cede0
documented order of conversion between u32 an ipv4addr
Mar 17, 2017
c96491f
Update libc to 0.2.21
malbarbo Mar 7, 2017
5798817
Fix c_char (u8 -> i8) definition for i686-linux-android
malbarbo Mar 16, 2017
3435c60
Fix libc::bind call on aarch64-linux-android
malbarbo Mar 17, 2017
963d4df
minor wording tweak to slice::{as_ptr, as_mut_ptr}
QuietMisdreavus Mar 17, 2017
ec8ecf4
Fix typo in mutex.rs docs
ScottAbbey Mar 17, 2017
33a5665
Stabilize move_cell feature, closes #39264
aturon Mar 15, 2017
65b7c4e
Stabilize expect_err feature, closes #39041
aturon Mar 15, 2017
d38ea8b
Stabilize ptr_unaligned feature, closes #37955
aturon Mar 15, 2017
9511fe6
Stabilize process_abort feature, closes #37838
aturon Mar 15, 2017
10510ae
Stabilize ptr_eq feature, closes #36497
aturon Mar 15, 2017
37b38a2
Stabilize btree_range, closes #27787
aturon Mar 15, 2017
48890d4
Stabilize ordering_chaining, closes #37053
aturon Mar 15, 2017
a8f4a1b
Stabilize rc_raw feature, closes #37197
aturon Mar 15, 2017
1241a88
Minor fixups to fix tidy errors
alexcrichton Mar 15, 2017
9e19389
Rollup merge of #40281 - jimmycuadra:try-from-from-str, r=aturon
frewsxcv Mar 17, 2017
982f155
Rollup merge of #40317 - malbarbo:update-libc, r=alexcrichton
frewsxcv Mar 17, 2017
457b440
Rollup merge of #40346 - jseyfried:path_and_tokenstream_attr, r=nrc
frewsxcv Mar 17, 2017
4b63f47
Rollup merge of #40482 - wagenet:fix-old-macos, r=alexcrichton
frewsxcv Mar 17, 2017
2b87168
Rollup merge of #40507 - alexcrichton:static-libcurl, r=brson
frewsxcv Mar 17, 2017
12008de
Rollup merge of #40521 - TimNN:panic-free-shift, r=nagisa
frewsxcv Mar 17, 2017
338b0c3
Rollup merge of #40538 - aturon:stab-1.17, r=alexcrichton
frewsxcv Mar 17, 2017
cfeeaad
Rollup merge of #40564 - GuillaumeGomez:rustdoc-const, r=frewsxcv
frewsxcv Mar 17, 2017
fe378bd
Rollup merge of #40581 - TimNN:di-global-40, r=alexcrichton
frewsxcv Mar 17, 2017
7888da6
Rollup merge of #40590 - z1mvader:master, r=steveklabnik
frewsxcv Mar 17, 2017
9390977
Rollup merge of #40603 - QuietMisdreavus:slice-ptr-docs, r=GuillaumeG…
frewsxcv Mar 17, 2017
4a87703
Rollup merge of #40611 - ScottAbbey:patch-1, r=GuillaumeGomez
frewsxcv Mar 17, 2017
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
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode8.2
install: &osx_install_sccache >
Expand All @@ -60,6 +62,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode8.2
install: *osx_install_sccache
Expand All @@ -72,6 +76,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode8.2
install: >
Expand All @@ -85,6 +91,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode8.2
install: *osx_install_sccache
Expand All @@ -102,6 +110,8 @@ matrix:
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log
RUST_LOG=sccache=debug
MACOSX_DEPLOYMENT_TARGET=10.8
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode8.2
install: *osx_install_sccache
Expand Down
9 changes: 9 additions & 0 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use std::collections::HashMap;
use std::fs::{self, File};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::env;

use build_helper::{output, mtime, up_to_date};
use filetime::FileTime;
Expand All @@ -44,6 +45,11 @@ pub fn std(build: &Build, target: &str, compiler: &Compiler) {
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
let mut cargo = build.cargo(compiler, Mode::Libstd, target, "build");
let mut features = build.std_features();

if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
}

// When doing a local rebuild we tell cargo that we're stage1 rather than
// stage0. This works fine if the local rust and being-built rust have the
// same view of what the default allocator is, but fails otherwise. Since
Expand Down Expand Up @@ -170,6 +176,9 @@ pub fn test(build: &Build, target: &str, compiler: &Compiler) {
let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
build.clear_if_dirty(&out_dir, &libstd_stamp(build, compiler, target));
let mut cargo = build.cargo(compiler, Mode::Libtest, target, "build");
if let Ok(target) = env::var("MACOSX_STD_DEPLOYMENT_TARGET") {
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
}
cargo.arg("--manifest-path")
.arg(build.src.join("src/libtest/Cargo.toml"));
build.run(&mut cargo);
Expand Down
6 changes: 6 additions & 0 deletions src/ci/docker/dist-x86-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,10 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-sanitizers
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS

# This is the only builder which will create source tarballs
ENV DIST_SRC 1

# When we build cargo in this container, we don't want it to use the system
# libcurl, instead it should compile its own.
ENV LIBCURL_NO_PKG_CONFIG 1
31 changes: 13 additions & 18 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,15 @@ impl<T> Arc<T> {
/// # Examples
///
/// ```
/// #![feature(rc_raw)]
///
/// use std::sync::Arc;
///
/// let x = Arc::new(10);
/// let x_ptr = Arc::into_raw(x);
/// assert_eq!(unsafe { *x_ptr }, 10);
/// ```
#[unstable(feature = "rc_raw", issue = "37197")]
pub fn into_raw(this: Self) -> *mut T {
let ptr = unsafe { &mut (**this.ptr).data as *mut _ };
#[stable(feature = "rc_raw", since = "1.17.0")]
pub fn into_raw(this: Self) -> *const T {
let ptr = unsafe { &(**this.ptr).data as *const _ };
mem::forget(this);
ptr
}
Expand All @@ -315,8 +313,6 @@ impl<T> Arc<T> {
/// # Examples
///
/// ```
/// #![feature(rc_raw)]
///
/// use std::sync::Arc;
///
/// let x = Arc::new(10);
Expand All @@ -332,11 +328,14 @@ impl<T> Arc<T> {
///
/// // The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
/// ```
#[unstable(feature = "rc_raw", issue = "37197")]
pub unsafe fn from_raw(ptr: *mut T) -> Self {
#[stable(feature = "rc_raw", since = "1.17.0")]
pub unsafe fn from_raw(ptr: *const T) -> Self {
// To find the corresponding pointer to the `ArcInner` we need to subtract the offset of the
// `data` field from the pointer.
Arc { ptr: Shared::new((ptr as *mut u8).offset(-offset_of!(ArcInner<T>, data)) as *mut _) }
let ptr = (ptr as *const u8).offset(-offset_of!(ArcInner<T>, data));
Arc {
ptr: Shared::new(ptr as *const _),
}
}
}

Expand Down Expand Up @@ -448,7 +447,7 @@ impl<T: ?Sized> Arc<T> {
// Non-inlined part of `drop`.
#[inline(never)]
unsafe fn drop_slow(&mut self) {
let ptr = *self.ptr;
let ptr = self.ptr.as_mut_ptr();

// Destroy the data at this time, even though we may not free the box
// allocation itself (there may still be weak pointers lying around).
Expand All @@ -461,17 +460,13 @@ impl<T: ?Sized> Arc<T> {
}

#[inline]
#[unstable(feature = "ptr_eq",
reason = "newly added",
issue = "36497")]
#[stable(feature = "ptr_eq", since = "1.17.0")]
/// Returns true if the two `Arc`s point to the same value (not
/// just values that compare as equal).
///
/// # Examples
///
/// ```
/// #![feature(ptr_eq)]
///
/// use std::sync::Arc;
///
/// let five = Arc::new(5);
Expand Down Expand Up @@ -628,7 +623,7 @@ impl<T: Clone> Arc<T> {
// As with `get_mut()`, the unsafety is ok because our reference was
// either unique to begin with, or became one upon cloning the contents.
unsafe {
let inner = &mut **this.ptr;
let inner = &mut *this.ptr.as_mut_ptr();
&mut inner.data
}
}
Expand Down Expand Up @@ -671,7 +666,7 @@ impl<T: ?Sized> Arc<T> {
// the Arc itself to be `mut`, so we're returning the only possible
// reference to the inner data.
unsafe {
let inner = &mut **this.ptr;
let inner = &mut *this.ptr.as_mut_ptr();
Some(&mut inner.data)
}
} else {
Expand Down
28 changes: 10 additions & 18 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,15 @@ impl<T> Rc<T> {
/// # Examples
///
/// ```
/// #![feature(rc_raw)]
///
/// use std::rc::Rc;
///
/// let x = Rc::new(10);
/// let x_ptr = Rc::into_raw(x);
/// assert_eq!(unsafe { *x_ptr }, 10);
/// ```
#[unstable(feature = "rc_raw", issue = "37197")]
pub fn into_raw(this: Self) -> *mut T {
let ptr = unsafe { &mut (**this.ptr).value as *mut _ };
#[stable(feature = "rc_raw", since = "1.17.0")]
pub fn into_raw(this: Self) -> *const T {
let ptr = unsafe { &mut (*this.ptr.as_mut_ptr()).value as *const _ };
mem::forget(this);
ptr
}
Expand All @@ -392,8 +390,6 @@ impl<T> Rc<T> {
/// # Examples
///
/// ```
/// #![feature(rc_raw)]
///
/// use std::rc::Rc;
///
/// let x = Rc::new(10);
Expand All @@ -409,11 +405,11 @@ impl<T> Rc<T> {
///
/// // The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
/// ```
#[unstable(feature = "rc_raw", issue = "37197")]
pub unsafe fn from_raw(ptr: *mut T) -> Self {
#[stable(feature = "rc_raw", since = "1.17.0")]
pub unsafe fn from_raw(ptr: *const T) -> Self {
// To find the corresponding pointer to the `RcBox` we need to subtract the offset of the
// `value` field from the pointer.
Rc { ptr: Shared::new((ptr as *mut u8).offset(-offset_of!(RcBox<T>, value)) as *mut _) }
Rc { ptr: Shared::new((ptr as *const u8).offset(-offset_of!(RcBox<T>, value)) as *const _) }
}
}

Expand Down Expand Up @@ -543,25 +539,21 @@ impl<T: ?Sized> Rc<T> {
#[stable(feature = "rc_unique", since = "1.4.0")]
pub fn get_mut(this: &mut Self) -> Option<&mut T> {
if Rc::is_unique(this) {
let inner = unsafe { &mut **this.ptr };
let inner = unsafe { &mut *this.ptr.as_mut_ptr() };
Some(&mut inner.value)
} else {
None
}
}

#[inline]
#[unstable(feature = "ptr_eq",
reason = "newly added",
issue = "36497")]
#[stable(feature = "ptr_eq", since = "1.17.0")]
/// Returns true if the two `Rc`s point to the same value (not
/// just values that compare as equal).
///
/// # Examples
///
/// ```
/// #![feature(ptr_eq)]
///
/// use std::rc::Rc;
///
/// let five = Rc::new(5);
Expand Down Expand Up @@ -631,7 +623,7 @@ impl<T: Clone> Rc<T> {
// reference count is guaranteed to be 1 at this point, and we required
// the `Rc<T>` itself to be `mut`, so we're returning the only possible
// reference to the inner value.
let inner = unsafe { &mut **this.ptr };
let inner = unsafe { &mut *this.ptr.as_mut_ptr() };
&mut inner.value
}
}
Expand Down Expand Up @@ -677,7 +669,7 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Rc<T> {
/// ```
fn drop(&mut self) {
unsafe {
let ptr = *self.ptr;
let ptr = self.ptr.as_mut_ptr();

self.dec_strong();
if self.strong() == 0 {
Expand Down
14 changes: 4 additions & 10 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
}

/// An iterator over a sub-range of BTreeMap's entries.
#[stable(feature = "btree_range", since = "1.17.0")]
pub struct Range<'a, K: 'a, V: 'a> {
front: Handle<NodeRef<marker::Immut<'a>, K, V, marker::Leaf>, marker::Edge>,
back: Handle<NodeRef<marker::Immut<'a>, K, V, marker::Leaf>, marker::Edge>,
Expand All @@ -351,6 +352,7 @@ impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Range<'a, K, V>
}

/// A mutable iterator over a sub-range of BTreeMap's entries.
#[stable(feature = "btree_range", since = "1.17.0")]
pub struct RangeMut<'a, K: 'a, V: 'a> {
front: Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::Edge>,
back: Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::Edge>,
Expand Down Expand Up @@ -724,8 +726,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// Basic usage:
///
/// ```
/// #![feature(btree_range, collections_bound)]
///
/// use std::collections::BTreeMap;
/// use std::collections::Bound::Included;
///
Expand All @@ -738,9 +738,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// }
/// assert_eq!(Some((&5, &"b")), map.range(4..).next());
/// ```
#[unstable(feature = "btree_range",
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27787")]
#[stable(feature = "btree_range", since = "1.17.0")]
pub fn range<T: ?Sized, R>(&self, range: R) -> Range<K, V>
where T: Ord, K: Borrow<T>, R: RangeArgument<T>
{
Expand Down Expand Up @@ -768,8 +766,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// Basic usage:
///
/// ```
/// #![feature(btree_range)]
///
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<&str, i32> = ["Alice", "Bob", "Carol", "Cheryl"].iter()
Expand All @@ -782,9 +778,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// println!("{} => {}", name, balance);
/// }
/// ```
#[unstable(feature = "btree_range",
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27787")]
#[stable(feature = "btree_range", since = "1.17.0")]
pub fn range_mut<T: ?Sized, R>(&mut self, range: R) -> RangeMut<K, V>
where T: Ord, K: Borrow<T>, R: RangeArgument<T>
{
Expand Down
7 changes: 2 additions & 5 deletions src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub struct IntoIter<T> {
/// [`BTreeSet`]: struct.BTreeSet.html
/// [`range`]: struct.BTreeSet.html#method.range
#[derive(Debug)]
#[stable(feature = "btree_range", since = "1.17.0")]
pub struct Range<'a, T: 'a> {
iter: ::btree_map::Range<'a, T, ()>,
}
Expand Down Expand Up @@ -264,8 +265,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// #![feature(btree_range, collections_bound)]
///
/// use std::collections::BTreeSet;
/// use std::collections::Bound::Included;
///
Expand All @@ -278,9 +277,7 @@ impl<T: Ord> BTreeSet<T> {
/// }
/// assert_eq!(Some(&5), set.range(4..).next());
/// ```
#[unstable(feature = "btree_range",
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27787")]
#[stable(feature = "btree_range", since = "1.17.0")]
pub fn range<K: ?Sized, R>(&self, range: R) -> Range<T>
where K: Ord, T: Borrow<K>, R: RangeArgument<K>
{
Expand Down
5 changes: 4 additions & 1 deletion src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,17 @@ mod std {
}

/// An endpoint of a range of keys.
#[unstable(feature = "collections_bound", issue = "27787")]
#[stable(feature = "collections_bound", since = "1.17.0")]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub enum Bound<T> {
/// An inclusive bound.
#[stable(feature = "collections_bound", since = "1.17.0")]
Included(T),
/// An exclusive bound.
#[stable(feature = "collections_bound", since = "1.17.0")]
Excluded(T),
/// An infinite endpoint. Indicates that there is no bound in this direction.
#[stable(feature = "collections_bound", since = "1.17.0")]
Unbounded,
}

Expand Down
Loading