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 #40867

Merged
merged 46 commits into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3ec61ea
save-analysis: allow clients to get data directly without writing to …
nrc Mar 23, 2017
5ca8a73
std: Don't cache stdio handles on Windows
alexcrichton Mar 14, 2017
1a87fc2
convert `custom_coerce_unsized_kind` into a `coerce_unsized_info`
nikomatsakis Mar 17, 2017
8e6b10a
move `check` to the top of the file, where I would expect to find it
nikomatsakis Mar 20, 2017
a29ae30
convert inherent-impl-related things to on-demand queries
nikomatsakis Mar 20, 2017
b470354
Update cargo submodule
alexcrichton Mar 23, 2017
29a052d
Fix ICE with nested macros in certain situations.
jseyfried Mar 25, 2017
8b92255
Don't stutter in operator descriptions #29365
theotherphil Mar 25, 2017
779d2f3
Link ParseBoolError to from_str method of bool
donniebishop Mar 25, 2017
6344d08
Update libc to 0.2.21
malbarbo Mar 7, 2017
a7add43
Fix c_char (u8 -> i8) definition for i686-linux-android
malbarbo Mar 16, 2017
b45c631
Fix libc::bind call on aarch64-linux-android
malbarbo Mar 17, 2017
33a6a07
FromStr implementation example
donniebishop Mar 25, 2017
64cd0be
Remove trailing whitespace
donniebishop Mar 25, 2017
fb5e63f
Change `try!` to `?`
donniebishop Mar 25, 2017
2e14bfe
rustdoc to accept `#` at the start of a markdown file #40560
projektir Mar 25, 2017
24be899
Avoid using libc::sigemptyset on Android
malbarbo Mar 25, 2017
53b7095
char::to_uppercase doc typo: s/lowercase/uppercase/
Wallacoloo Mar 25, 2017
188299e
char::to_uppercase doc typo: use the 'an' article.
Wallacoloo Mar 25, 2017
6e6dec0
change string references in asciiext r? @steveklabnik
alanstoate Mar 26, 2017
fda8e15
libcore: sort_unstable: improve randomization in break_patterns.
pftbest Mar 25, 2017
1579fbd
Fixed spelling mistakes
alanstoate Mar 26, 2017
737511e
Ensure that macro resolutions in trait positions get finalized.
jseyfried Mar 27, 2017
79feb94
allow `InternedString` to be compared to `str` directly
oli-obk Mar 9, 2017
eb447f4
Fix various useless derefs and slicings
oli-obk Mar 24, 2017
3545fb5
rustbuild: Fix compiler docs again
ollie27 Mar 27, 2017
99a069e
Fix broken Markdown and bad links in the error index
ollie27 Mar 27, 2017
e87dd42
appveyor: Downgrade MinGW to 6.2.0
alexcrichton Mar 27, 2017
e857e29
Rollup merge of #40317 - malbarbo:update-libc, r=alexcrichton
alexcrichton Mar 27, 2017
76cc08b
Rollup merge of #40516 - alexcrichton:no-cache-handles, r=aturon
alexcrichton Mar 27, 2017
666bb19
Rollup merge of #40606 - oli-obk:interned_str_usability, r=jseyfried
alexcrichton Mar 27, 2017
12f6c50
Rollup merge of #40683 - nikomatsakis:incr-comp-coerce-unsized-info, …
alexcrichton Mar 27, 2017
5137115
Rollup merge of #40751 - nrc:save-callback, r=eddyb
alexcrichton Mar 27, 2017
bccd341
Rollup merge of #40778 - alexcrichton:update-cargo, r=alexcrichton
alexcrichton Mar 27, 2017
1fe2dfc
Rollup merge of #40813 - jseyfried:fix_expansion_regression, r=nrc
alexcrichton Mar 27, 2017
bae772b
Rollup merge of #40818 - theotherphil:master, r=steveklabnik
alexcrichton Mar 27, 2017
84712fa
Rollup merge of #40819 - donniebishop:master, r=alexcrichton
alexcrichton Mar 27, 2017
6b2c4bf
Rollup merge of #40824 - donniebishop:fromstr_docexample, r=steveklabnik
alexcrichton Mar 27, 2017
4d93c12
Rollup merge of #40828 - projektir:markdown_metadata, r=steveklabnik
alexcrichton Mar 27, 2017
5e9d918
Rollup merge of #40832 - pftbest:fix_msp430, r=stjepang
alexcrichton Mar 27, 2017
8cfc93f
Rollup merge of #40833 - Wallacoloo:doc_to_uppercase_typo, r=stevekla…
alexcrichton Mar 27, 2017
498da9f
Rollup merge of #40837 - alanstoate:ascii-docs, r=steveklabnik
alexcrichton Mar 27, 2017
68c7385
Rollup merge of #40849 - jseyfried:finalize_trait_macro_resolutions, …
alexcrichton Mar 27, 2017
700e2ea
Rollup merge of #40852 - ollie27:rustbuild_compiler_docs, r=alexcrichton
alexcrichton Mar 27, 2017
0dbf84b
Rollup merge of #40853 - ollie27:error-index, r=steveklabnik
alexcrichton Mar 27, 2017
61928a0
Rollup merge of #40865 - alexcrichton:downgrade-mingw, r=arielb1
alexcrichton Mar 27, 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
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ environment:
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-ninja
SCRIPT: python x.py test
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: i686-6.3.0-release-win32-dwarf-rt_v5-rev1.7z
MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z
MINGW_DIR: mingw32
- MSYS_BITS: 64
SCRIPT: python x.py test
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-ninja
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: x86_64-6.3.0-release-win32-seh-rt_v5-rev1.7z
MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z
MINGW_DIR: mingw64

# 32/64 bit MSVC and GNU deployment
Expand All @@ -71,14 +71,14 @@ environment:
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-extended --enable-ninja
SCRIPT: python x.py dist
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: i686-6.3.0-release-win32-dwarf-rt_v5-rev1.7z
MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z
MINGW_DIR: mingw32
DEPLOY: 1
- MSYS_BITS: 64
SCRIPT: python x.py dist
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-extended --enable-ninja
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: x86_64-6.3.0-release-win32-seh-rt_v5-rev1.7z
MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z
MINGW_DIR: mingw64
DEPLOY: 1

Expand Down
8 changes: 8 additions & 0 deletions src/bootstrap/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ fn main() {
.arg(sysroot)
.env(bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap());

// Pass the `rustbuild` feature flag to crates which rustbuild is
// building. See the comment in bootstrap/lib.rs where this env var is
// set for more details.
if env::var_os("RUSTBUILD_UNSTABLE").is_some() {
cmd.arg("--cfg").arg("rustbuild");
}

std::process::exit(match cmd.status() {
Ok(s) => s.code().unwrap_or(1),
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ fn android_copy_libs(build: &Build, compiler: &Compiler, target: &str) {
.arg(ADB_TEST_DIR));

let target_dir = format!("{}/{}", ADB_TEST_DIR, target);
build.run(Command::new("adb").args(&["shell", "mkdir", &target_dir[..]]));
build.run(Command::new("adb").args(&["shell", "mkdir", &target_dir]));

for f in t!(build.sysroot_libdir(compiler, target).read_dir()) {
let f = t!(f);
Expand Down
6 changes: 3 additions & 3 deletions src/grammar/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_
let toknum = &s[content_end + 3 .. toknum_end];

let not_found = format!("didn't find token {:?} in the map", toknum);
let proto_tok = tokens.get(toknum).expect(&not_found[..]);
let proto_tok = tokens.get(toknum).expect(&not_found);

let nm = Symbol::intern(content);

Expand Down Expand Up @@ -304,14 +304,14 @@ fn main() {
let mut token_file = File::open(&Path::new(&args.next().unwrap())).unwrap();
let mut token_list = String::new();
token_file.read_to_string(&mut token_list).unwrap();
let token_map = parse_token_list(&token_list[..]);
let token_map = parse_token_list(&token_list);

let stdin = std::io::stdin();
let lock = stdin.lock();
let lines = lock.lines();
let antlr_tokens = lines.map(|l| parse_antlr_token(l.unwrap().trim(),
&token_map,
&surrogate_pairs_pos[..],
&surrogate_pairs_pos,
has_bom));

for antlr_tok in antlr_tokens {
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ mod tests {
thread::spawn(move || {
check_links(&n);
let a: &[_] = &[&1, &2, &3];
assert_eq!(a, &n.iter().collect::<Vec<_>>()[..]);
assert_eq!(a, &*n.iter().collect::<Vec<_>>());
})
.join()
.ok()
Expand Down
44 changes: 22 additions & 22 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub trait Drop {
fn drop(&mut self);
}

/// The `Add` trait is used to specify the functionality of `+`.
/// The addition operator `+`.
///
/// # Examples
///
Expand Down Expand Up @@ -269,7 +269,7 @@ macro_rules! add_impl {

add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Sub` trait is used to specify the functionality of `-`.
/// The subtraction operator `-`.
///
/// # Examples
///
Expand Down Expand Up @@ -342,7 +342,7 @@ macro_rules! sub_impl {

sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Mul` trait is used to specify the functionality of `*`.
/// The multiplication operator `*`.
///
/// # Examples
///
Expand Down Expand Up @@ -464,7 +464,7 @@ macro_rules! mul_impl {

mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Div` trait is used to specify the functionality of `/`.
/// The division operator `/`.
///
/// # Examples
///
Expand Down Expand Up @@ -609,7 +609,7 @@ macro_rules! div_impl_float {

div_impl_float! { f32 f64 }

/// The `Rem` trait is used to specify the functionality of `%`.
/// The remainder operator `%`.
///
/// # Examples
///
Expand Down Expand Up @@ -689,7 +689,7 @@ macro_rules! rem_impl_float {

rem_impl_float! { f32 f64 }

/// The `Neg` trait is used to specify the functionality of unary `-`.
/// The unary negation operator `-`.
///
/// # Examples
///
Expand Down Expand Up @@ -768,7 +768,7 @@ macro_rules! neg_impl_unsigned {
// neg_impl_unsigned! { usize u8 u16 u32 u64 }
neg_impl_numeric! { isize i8 i16 i32 i64 i128 f32 f64 }

/// The `Not` trait is used to specify the functionality of unary `!`.
/// The unary logical negation operator `!`.
///
/// # Examples
///
Expand Down Expand Up @@ -826,7 +826,7 @@ macro_rules! not_impl {

not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitAnd` trait is used to specify the functionality of `&`.
/// The bitwise AND operator `&`.
///
/// # Examples
///
Expand Down Expand Up @@ -909,7 +909,7 @@ macro_rules! bitand_impl {

bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitOr` trait is used to specify the functionality of `|`.
/// The bitwise OR operator `|`.
///
/// # Examples
///
Expand Down Expand Up @@ -992,7 +992,7 @@ macro_rules! bitor_impl {

bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitXor` trait is used to specify the functionality of `^`.
/// The bitwise XOR operator `^`.
///
/// # Examples
///
Expand Down Expand Up @@ -1078,7 +1078,7 @@ macro_rules! bitxor_impl {

bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `Shl` trait is used to specify the functionality of `<<`.
/// The left shift operator `<<`.
///
/// # Examples
///
Expand Down Expand Up @@ -1181,7 +1181,7 @@ macro_rules! shl_impl_all {

shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }

/// The `Shr` trait is used to specify the functionality of `>>`.
/// The right shift operator `>>`.
///
/// # Examples
///
Expand Down Expand Up @@ -1284,7 +1284,7 @@ macro_rules! shr_impl_all {

shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }

/// The `AddAssign` trait is used to specify the functionality of `+=`.
/// The addition assignment operator `+=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1340,7 +1340,7 @@ macro_rules! add_assign_impl {

add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `SubAssign` trait is used to specify the functionality of `-=`.
/// The subtraction assignment operator `-=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1396,7 +1396,7 @@ macro_rules! sub_assign_impl {

sub_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `MulAssign` trait is used to specify the functionality of `*=`.
/// The multiplication assignment operator `*=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1441,7 +1441,7 @@ macro_rules! mul_assign_impl {

mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `DivAssign` trait is used to specify the functionality of `/=`.
/// The division assignment operator `/=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1485,7 +1485,7 @@ macro_rules! div_assign_impl {

div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `RemAssign` trait is used to specify the functionality of `%=`.
/// The remainder assignment operator `%=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1529,7 +1529,7 @@ macro_rules! rem_assign_impl {

rem_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }

/// The `BitAndAssign` trait is used to specify the functionality of `&=`.
/// The bitwise AND assignment operator `&=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1615,7 +1615,7 @@ macro_rules! bitand_assign_impl {

bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitOrAssign` trait is used to specify the functionality of `|=`.
/// The bitwise OR assignment operator `|=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1659,7 +1659,7 @@ macro_rules! bitor_assign_impl {

bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `BitXorAssign` trait is used to specify the functionality of `^=`.
/// The bitwise XOR assignment operator `^=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1703,7 +1703,7 @@ macro_rules! bitxor_assign_impl {

bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

/// The `ShlAssign` trait is used to specify the functionality of `<<=`.
/// The left shift assignment operator `<<=`.
///
/// # Examples
///
Expand Down Expand Up @@ -1768,7 +1768,7 @@ macro_rules! shl_assign_impl_all {

shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }

/// The `ShrAssign` trait is used to specify the functionality of `>>=`.
/// The right shift assignment operator `>>=`.
///
/// # Examples
///
Expand Down
56 changes: 32 additions & 24 deletions src/libcore/slice/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,32 +498,40 @@ fn partition_equal<T, F>(v: &mut [T], pivot: usize, is_less: &mut F) -> usize
#[cold]
fn break_patterns<T>(v: &mut [T]) {
let len = v.len();

if len >= 8 {
// A random number will be taken modulo this one. The modulus is a power of two so that we
// can simply take bitwise "and", thus avoiding costly CPU operations.
let modulus = (len / 4).next_power_of_two();
debug_assert!(modulus >= 1 && modulus <= len / 2);

// Pseudorandom number generation from the "Xorshift RNGs" paper by George Marsaglia.
let mut random = len;
random ^= random << 13;
random ^= random >> 17;
random ^= random << 5;
random &= modulus - 1;
debug_assert!(random < len / 2);

// The first index.
let a = len / 4 * 2;
debug_assert!(a >= 1 && a < len - 2);

// The second index.
let b = len / 4 + random;
debug_assert!(b >= 1 && b < len - 2);

// Swap neighbourhoods of `a` and `b`.
// Pseudorandom number generator from the "Xorshift RNGs" paper by George Marsaglia.
let mut random = len as u32;
let mut gen_u32 = || {
random ^= random << 13;
random ^= random >> 17;
random ^= random << 5;
random
};
let mut gen_usize = || {
if mem::size_of::<usize>() <= 4 {
gen_u32() as usize
} else {
(((gen_u32() as u64) << 32) | (gen_u32() as u64)) as usize
}
};

// Take random numbers modulo this number.
// The number fits into `usize` because `len` is not greater than `isize::MAX`.
let modulus = len.next_power_of_two();

// Some pivot candidates will be in the nearby of this index. Let's randomize them.
let pos = len / 4 * 2;

for i in 0..3 {
v.swap(a - 1 + i, b - 1 + i);
// Generate a random number modulo `len`. However, in order to avoid costly operations
// we first take it modulo a power of two, and then decrease by `len` until it fits
// into the range `[0, len - 1]`.
let mut other = gen_usize() & (modulus - 1);
while other >= len {
other -= len;
}

v.swap(pos - 1 + i, other);
}
}
}
Expand Down
Loading