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 19 pull requests #39563

Merged
merged 56 commits into from
Feb 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
02ae1e1
Support unprivileged symlink creation in Windows
chris-morgan Jan 8, 2017
9903975
Add 128-bit atomics
Amanieu Jan 10, 2017
6c94089
branchless .filter(_).count()
llogiq Jan 16, 2017
27f7615
fix style nits
llogiq Jan 17, 2017
b40432c
add test case for filter+count
llogiq Jan 18, 2017
c2eab73
Expand documentation of process::exit and exec
nagisa Dec 21, 2016
2bafbba
tell emcc stip exception handling if panic rt used
pepyakin Jan 19, 2017
62c088c
Separate emscripten args
pepyakin Jan 20, 2017
24cb5b7
Json encoding/decoding for is_like_emscripten
pepyakin Jan 20, 2017
bfabe81
add explanation, fix test
llogiq Jan 24, 2017
bb34856
Fix full path being output with `rustdoc -h`
mgattozzi Jan 26, 2017
9128f61
Fix a few impl stability attributes
ollie27 Jan 29, 2017
395f23c
save-analysis: be more paranoid about generated paths
nrc Feb 2, 2017
89f9767
Change tracking issue for `proc_macro` feature to #38356
abonander Feb 2, 2017
823e185
Suggest only if resolution was previously resolved
phungleson Feb 2, 2017
a0efdf3
Don't check for sudo environment if vendored sources are already conf…
djc Feb 2, 2017
8e793eb
Guard against USER not existing in the environment
djc Feb 2, 2017
51e5cb5
Fix typo in bootstrap.py info message
djc Feb 2, 2017
2add6ac
Add a name for the parameter to `TryFrom::try_from`.
jimmycuadra Feb 3, 2017
681bc5c
rustbuild: Add x.py to source tarballs
alexcrichton Feb 3, 2017
2cc84df
Add warning for () to ! switch
canndrew Jan 11, 2017
c570cd6
Fix make tidy
canndrew Jan 12, 2017
5dbaefb
Hash TyTuple's defaulted flag
canndrew Jan 12, 2017
085f046
Add is_defaulted_unit helper method
canndrew Jan 21, 2017
5c90dd7
Use a proper future-compatibility lint
canndrew Jan 21, 2017
6a99573
Fix test
canndrew Jan 21, 2017
40c9538
Fix test
canndrew Jan 29, 2017
7444d07
Fix test
canndrew Feb 4, 2017
42f3ac5
Expand defaulted unit test
canndrew Feb 4, 2017
b4ef361
README path correction
king6cong Feb 4, 2017
a40be08
libstd/net: Add `peek` APIs to UdpSocket and TcpStream
Jan 11, 2017
0477daf
Make builtin derives a SyntaxExtension
keeperofdakeys Jan 23, 2017
0a7380d
Rename CustomDerive to ProcMacroDerive for macros 1.1
keeperofdakeys Jan 23, 2017
fbdd038
Move derive macro expansion into the MacroExpander
keeperofdakeys Feb 1, 2017
8e02ad0
Provide Entry-like API for Option
shahn Jan 25, 2017
a201348
Update pretty test for derive attributes
keeperofdakeys Feb 5, 2017
5e06aee
correct version in which more_struct_aliases was/will be stable
zackmdavis Feb 5, 2017
001bfb9
Rollup merge of #38518 - nagisa:exec-doc, r=alexcrichton
frewsxcv Feb 5, 2017
6a4c906
Rollup merge of #38921 - chris-morgan:windows-unprivileged-symlink-cr…
frewsxcv Feb 5, 2017
c4c6c49
Rollup merge of #38959 - Amanieu:atomic128, r=alexcrichton
frewsxcv Feb 5, 2017
ca202fe
Rollup merge of #38983 - APTy:udp-peek, r=aturon
frewsxcv Feb 5, 2017
4f8ce9e
Rollup merge of #39009 - canndrew:default-unit-warnings, r=nikomatsakis
frewsxcv Feb 5, 2017
8163b4b
Rollup merge of #39107 - llogiq:branchless_filter_count, r=alexcrichton
frewsxcv Feb 5, 2017
49cd748
Rollup merge of #39193 - pepyakin:emcc-strip-panic-rt, r=alexcrichton
frewsxcv Feb 5, 2017
76e9ea7
Rollup merge of #39289 - shahn:option_entry, r=alexcrichton
frewsxcv Feb 5, 2017
5cfd5ed
Rollup merge of #39312 - mgattozzi:rustdoc-help-fix, r=alexcrichton
frewsxcv Feb 5, 2017
65b2477
Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichton
frewsxcv Feb 5, 2017
805a99e
Rollup merge of #39442 - keeperofdakeys:expand-derives, r=jseyfried
frewsxcv Feb 5, 2017
cd5c520
Rollup merge of #39443 - phungleson:remove-unresolved-things, r=nikom…
frewsxcv Feb 5, 2017
ece9240
Rollup merge of #39453 - nrc:save-path, r=nikomatsakis
frewsxcv Feb 5, 2017
296c07e
Rollup merge of #39454 - abonander:proc_macro_tracking_issue, r=jseyf…
frewsxcv Feb 5, 2017
e7f6c36
Rollup merge of #39471 - djc:bootstrap-user, r=alexcrichton
frewsxcv Feb 5, 2017
e06fa7c
Rollup merge of #39477 - jimmycuadra:try-from-parameter-name, r=alexc…
frewsxcv Feb 5, 2017
403ca55
Rollup merge of #39478 - alexcrichton:add-xpy, r=japaric
frewsxcv Feb 5, 2017
94fd315
Rollup merge of #39527 - king6cong:bootstrap-doc, r=alexcrichton
frewsxcv Feb 5, 2017
0a09274
Rollup merge of #39552 - zackmdavis:more_struct_aliases_stabilization…
frewsxcv Feb 5, 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
4 changes: 2 additions & 2 deletions src/bootstrap/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
//! rustbuild, the Rust build system
//!
//! This is the entry point for the build system used to compile the `rustc`
//! compiler. Lots of documentation can be found in the `README.md` file next to
//! this file, and otherwise documentation can be found throughout the `build`
//! compiler. Lots of documentation can be found in the `README.md` file in the
//! parent directory, and otherwise documentation can be found throughout the `build`
//! directory in each respective module.

#![deny(warnings)]
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,14 @@ def main():
rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \
'CFG_ENABLE_VENDOR' in rb.config_mk

if 'SUDO_USER' in os.environ:
if os.environ['USER'] != os.environ['SUDO_USER']:
if 'SUDO_USER' in os.environ and not rb.use_vendored_sources:
if os.environ.get('USER') != os.environ['SUDO_USER']:
rb.use_vendored_sources = True
print('info: looks like you are running this command under `sudo`')
print(' and so in order to preserve your $HOME this will now')
print(' use vendored sources by default. Note that if this')
print(' does not work you should run a normal build first')
print(' before running a command like `sudo make intall`')
print(' before running a command like `sudo make install`')

if rb.use_vendored_sources:
if not os.path.exists('.cargo'):
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ pub fn rust_src(build: &Build) {
"README.md",
"RELEASES.md",
"configure",
"Makefile.in"
"Makefile.in",
"x.py",
];
let src_dirs = [
"man",
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {
#[unstable(feature = "fused", issue = "35602")]
impl<'a, T: 'a> FusedIterator for Drain<'a, T> {}

#[stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
fn from(vec: Vec<T>) -> BinaryHeap<T> {
let mut heap = BinaryHeap { data: vec };
Expand All @@ -1097,7 +1097,7 @@ impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
}
}

#[stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
impl<T> From<BinaryHeap<T>> for Vec<T> {
fn from(heap: BinaryHeap<T>) -> Vec<T> {
heap.data
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ impl ExactSizeIterator for EscapeUnicode {
#[unstable(feature = "fused", issue = "35602")]
impl FusedIterator for EscapeUnicode {}

#[stable(feature = "char_struct_display", since = "1.17.0")]
#[stable(feature = "char_struct_display", since = "1.16.0")]
impl fmt::Display for EscapeUnicode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for c in self.clone() {
Expand Down Expand Up @@ -701,7 +701,7 @@ impl ExactSizeIterator for EscapeDefault {
#[unstable(feature = "fused", issue = "35602")]
impl FusedIterator for EscapeDefault {}

#[stable(feature = "char_struct_display", since = "1.17.0")]
#[stable(feature = "char_struct_display", since = "1.16.0")]
impl fmt::Display for EscapeDefault {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for c in self.clone() {
Expand Down Expand Up @@ -735,7 +735,7 @@ impl ExactSizeIterator for EscapeDebug { }
#[unstable(feature = "fused", issue = "35602")]
impl FusedIterator for EscapeDebug {}

#[stable(feature = "char_struct_display", since = "1.17.0")]
#[unstable(feature = "char_escape_debug", issue = "35068")]
impl fmt::Display for EscapeDebug {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&self.0, f)
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub trait TryFrom<T>: Sized {
type Err;

/// Performs the conversion.
fn try_from(T) -> Result<Self, Self::Err>;
fn try_from(value: T) -> Result<Self, Self::Err>;
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
16 changes: 12 additions & 4 deletions src/libcore/internal_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
// based on "op T" where T is expected to be `Copy`able
macro_rules! forward_ref_unop {
(impl $imp:ident, $method:ident for $t:ty) => {
#[stable(feature = "rust1", since = "1.0.0")]
forward_ref_unop!(impl $imp, $method for $t,
#[stable(feature = "rust1", since = "1.0.0")]);
};
(impl $imp:ident, $method:ident for $t:ty, #[$attr:meta]) => {
#[$attr]
impl<'a> $imp for &'a $t {
type Output = <$t as $imp>::Output;

Expand All @@ -29,7 +33,11 @@ macro_rules! forward_ref_unop {
// based on "T op U" where T and U are expected to be `Copy`able
macro_rules! forward_ref_binop {
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
#[stable(feature = "rust1", since = "1.0.0")]
forward_ref_binop!(impl $imp, $method for $t, $u,
#[stable(feature = "rust1", since = "1.0.0")]);
};
(impl $imp:ident, $method:ident for $t:ty, $u:ty, #[$attr:meta]) => {
#[$attr]
impl<'a> $imp<$u> for &'a $t {
type Output = <$t as $imp<$u>>::Output;

Expand All @@ -39,7 +47,7 @@ macro_rules! forward_ref_binop {
}
}

#[stable(feature = "rust1", since = "1.0.0")]
#[$attr]
impl<'a> $imp<&'a $u> for $t {
type Output = <$t as $imp<$u>>::Output;

Expand All @@ -49,7 +57,7 @@ macro_rules! forward_ref_binop {
}
}

#[stable(feature = "rust1", since = "1.0.0")]
#[$attr]
impl<'a, 'b> $imp<&'a $u> for &'b $t {
type Output = <$t as $imp<$u>>::Output;

Expand Down
22 changes: 21 additions & 1 deletion src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ impl<I: Iterator, P> Iterator for Filter<I, P> where P: FnMut(&I::Item) -> bool

#[inline]
fn next(&mut self) -> Option<I::Item> {
for x in self.iter.by_ref() {
for x in &mut self.iter {
if (self.predicate)(&x) {
return Some(x);
}
Expand All @@ -1099,6 +1099,26 @@ impl<I: Iterator, P> Iterator for Filter<I, P> where P: FnMut(&I::Item) -> bool
let (_, upper) = self.iter.size_hint();
(0, upper) // can't know a lower bound, due to the predicate
}

// this special case allows the compiler to make `.filter(_).count()`
// branchless. Barring perfect branch prediction (which is unattainable in
// the general case), this will be much faster in >90% of cases (containing
// virtually all real workloads) and only a tiny bit slower in the rest.
//
// Having this specialization thus allows us to write `.filter(p).count()`
// where we would otherwise write `.map(|x| p(x) as usize).sum()`, which is
// less readable and also less backwards-compatible to Rust before 1.10.
//
// Using the branchless version will also simplify the LLVM byte code, thus
// leaving more budget for LLVM optimizations.
#[inline]
fn count(mut self) -> usize {
let mut count = 0;
for x in &mut self.iter {
count += (self.predicate)(&x) as usize;
}
count
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
18 changes: 11 additions & 7 deletions src/libcore/iter/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,38 +661,42 @@ pub trait Product<A = Self>: Sized {

// NB: explicitly use Add and Mul here to inherit overflow checks
macro_rules! integer_sum_product {
(@impls $zero:expr, $one:expr, $($a:ty)*) => ($(
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
(@impls $zero:expr, $one:expr, #[$attr:meta], $($a:ty)*) => ($(
#[$attr]
impl Sum for $a {
fn sum<I: Iterator<Item=$a>>(iter: I) -> $a {
iter.fold($zero, Add::add)
}
}

#[stable(feature = "iter_arith_traits", since = "1.12.0")]
#[$attr]
impl Product for $a {
fn product<I: Iterator<Item=$a>>(iter: I) -> $a {
iter.fold($one, Mul::mul)
}
}

#[stable(feature = "iter_arith_traits", since = "1.12.0")]
#[$attr]
impl<'a> Sum<&'a $a> for $a {
fn sum<I: Iterator<Item=&'a $a>>(iter: I) -> $a {
iter.fold($zero, Add::add)
}
}

#[stable(feature = "iter_arith_traits", since = "1.12.0")]
#[$attr]
impl<'a> Product<&'a $a> for $a {
fn product<I: Iterator<Item=&'a $a>>(iter: I) -> $a {
iter.fold($one, Mul::mul)
}
}
)*);
($($a:ty)*) => (
integer_sum_product!(@impls 0, 1, $($a)+);
integer_sum_product!(@impls Wrapping(0), Wrapping(1), $(Wrapping<$a>)+);
integer_sum_product!(@impls 0, 1,
#[stable(feature = "iter_arith_traits", since = "1.12.0")],
$($a)+);
integer_sum_product!(@impls Wrapping(0), Wrapping(1),
#[stable(feature = "wrapping_iter_arith", since = "1.14.0")],
$(Wrapping<$a>)+);
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/libcore/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

macro_rules! int_module {
($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
($T:ident, $($attr: tt)*) => (
($T:ident, #[$attr:meta]) => (
/// The smallest value that can be represented by this integer type.
$($attr)*
#[$attr]
pub const MIN: $T = $T::min_value();
/// The largest value that can be represented by this integer type.
$($attr)*
#[$attr]
pub const MAX: $T = $T::max_value();
)
}
6 changes: 3 additions & 3 deletions src/libcore/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

macro_rules! uint_module {
($T:ident) => (uint_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
($T:ident, $($attr: tt)*) => (
($T:ident, #[$attr:meta]) => (
/// The smallest value that can be represented by this integer type.
$($attr)*
#[$attr]
pub const MIN: $T = $T::min_value();
/// The largest value that can be represented by this integer type.
$($attr)*
#[$attr]
pub const MAX: $T = $T::max_value();
)
}
30 changes: 20 additions & 10 deletions src/libcore/num/wrapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0.wrapping_add(other.0))
}
}
forward_ref_binop! { impl Add, add for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl Add, add for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl AddAssign for Wrapping<$t> {
Expand All @@ -150,7 +151,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0.wrapping_sub(other.0))
}
}
forward_ref_binop! { impl Sub, sub for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl Sub, sub for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl SubAssign for Wrapping<$t> {
Expand All @@ -169,7 +171,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0.wrapping_mul(other.0))
}
}
forward_ref_binop! { impl Mul, mul for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl Mul, mul for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl MulAssign for Wrapping<$t> {
Expand All @@ -188,7 +191,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0.wrapping_div(other.0))
}
}
forward_ref_binop! { impl Div, div for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl Div, div for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl DivAssign for Wrapping<$t> {
Expand All @@ -207,7 +211,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0.wrapping_rem(other.0))
}
}
forward_ref_binop! { impl Rem, rem for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl Rem, rem for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl RemAssign for Wrapping<$t> {
Expand All @@ -226,7 +231,8 @@ macro_rules! wrapping_impl {
Wrapping(!self.0)
}
}
forward_ref_unop! { impl Not, not for Wrapping<$t> }
forward_ref_unop! { impl Not, not for Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "rust1", since = "1.0.0")]
impl BitXor for Wrapping<$t> {
Expand All @@ -237,7 +243,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0 ^ other.0)
}
}
forward_ref_binop! { impl BitXor, bitxor for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl BitXor, bitxor for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl BitXorAssign for Wrapping<$t> {
Expand All @@ -256,7 +263,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0 | other.0)
}
}
forward_ref_binop! { impl BitOr, bitor for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl BitOr, bitor for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl BitOrAssign for Wrapping<$t> {
Expand All @@ -275,7 +283,8 @@ macro_rules! wrapping_impl {
Wrapping(self.0 & other.0)
}
}
forward_ref_binop! { impl BitAnd, bitand for Wrapping<$t>, Wrapping<$t> }
forward_ref_binop! { impl BitAnd, bitand for Wrapping<$t>, Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }

#[stable(feature = "op_assign_traits", since = "1.8.0")]
impl BitAndAssign for Wrapping<$t> {
Expand All @@ -293,7 +302,8 @@ macro_rules! wrapping_impl {
Wrapping(0) - self
}
}
forward_ref_unop! { impl Neg, neg for Wrapping<$t> }
forward_ref_unop! { impl Neg, neg for Wrapping<$t>,
#[stable(feature = "wrapping_ref", since = "1.14.0")] }
)*)
}

Expand Down
Loading