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 9 pull requests #38466

Merged
merged 19 commits into from
Dec 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d409fc3
Rewrite, improve documentation for `core::hash::BuildHasherDefault`.
frewsxcv Dec 13, 2016
e900f6c
rustc: Disable NEON on armv7 android.
rillian Dec 16, 2016
9e01f76
rustc: Link to Android ABI requirements.
rillian Dec 16, 2016
26d4308
Replace invalid use of `&mut` with `UnsafeCell` in `std::sync::mpsc`
apasel422 Dec 16, 2016
ca37604
tidy features: use 2-parameter form of internal try macro for open err
zackmdavis Dec 17, 2016
c3423a6
Update beta bootstrap compiler
alexcrichton Dec 17, 2016
1e7bc90
stage0.txt: typo fix
est31 Dec 18, 2016
79e8a70
Add missing urls for thread doc module
GuillaumeGomez Dec 17, 2016
4d392d3
Document platform-specific differences for `std::process::exit`.
frewsxcv Dec 15, 2016
b3b2f1b
Use exec for the wrapper on UNIXes
nagisa Dec 18, 2016
86cf922
Rollup merge of #38334 - frewsxcv:BuildHasherDefault, r=GuillaumeGomez
sanxiyn Dec 19, 2016
0c4e1db
Rollup merge of #38397 - frewsxcv:platform-specific-process-exit, r=a…
sanxiyn Dec 19, 2016
d38becc
Rollup merge of #38413 - rillian:armv7-neon, r=alexcrichton
sanxiyn Dec 19, 2016
4b5cffc
Rollup merge of #38421 - apasel422:issue-36934, r=alexcrichton
sanxiyn Dec 19, 2016
813af34
Rollup merge of #38422 - zackmdavis:enjoy_tidy_path_error_macro_nicet…
sanxiyn Dec 19, 2016
49cd809
Rollup merge of #38433 - GuillaumeGomez:thread_docs, r=frewsxcv
sanxiyn Dec 19, 2016
9f18f25
Rollup merge of #38438 - alexcrichton:update-beta, r=brson
sanxiyn Dec 19, 2016
fda41c6
Rollup merge of #38445 - est31:master, r=apasel422
sanxiyn Dec 19, 2016
05be48b
Rollup merge of #38459 - nagisa:rustbuild-exec, r=alexcrichton
sanxiyn Dec 19, 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
17 changes: 14 additions & 3 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern crate bootstrap;
use std::env;
use std::ffi::OsString;
use std::path::PathBuf;
use std::process::Command;
use std::process::{Command, ExitStatus};

fn main() {
let args = env::args_os().skip(1).collect::<Vec<_>>();
Expand Down Expand Up @@ -180,8 +180,19 @@ fn main() {
}

// Actually run the compiler!
std::process::exit(match cmd.status() {
Ok(s) => s.code().unwrap_or(1),
std::process::exit(match exec_cmd(&mut cmd) {
Ok(s) => s.code().unwrap_or(0xfe),
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
})
}

#[cfg(unix)]
fn exec_cmd(cmd: &mut Command) -> ::std::io::Result<ExitStatus> {
use std::os::unix::process::CommandExt;
Err(cmd.exec())
}

#[cfg(not(unix))]
fn exec_cmd(cmd: &mut Command) -> ::std::io::Result<ExitStatus> {
cmd.status()
}
40 changes: 37 additions & 3 deletions src/libcore/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,44 @@ pub trait BuildHasher {
fn build_hasher(&self) -> Self::Hasher;
}

/// A structure which implements `BuildHasher` for all `Hasher` types which also
/// implement `Default`.
/// The `BuildHasherDefault` structure is used in scenarios where one has a
/// type that implements [`Hasher`] and [`Default`], but needs that type to
/// implement [`BuildHasher`].
///
/// This struct is 0-sized and does not need construction.
/// This structure is zero-sized and does not need construction.
///
/// # Examples
///
/// Using `BuildHasherDefault` to specify a custom [`BuildHasher`] for
/// [`HashMap`]:
///
/// ```
/// use std::collections::HashMap;
/// use std::hash::{BuildHasherDefault, Hasher};
///
/// #[derive(Default)]
/// struct MyHasher;
///
/// impl Hasher for MyHasher {
/// fn write(&mut self, bytes: &[u8]) {
/// // Your hashing algorithm goes here!
/// unimplemented!()
/// }
///
/// fn finish(&self) -> u64 {
/// // Your hashing algorithm goes here!
/// unimplemented!()
/// }
/// }
///
/// type MyBuildHasher = BuildHasherDefault<MyHasher>;
///
/// let hash_map = HashMap::<u32, u32, MyBuildHasher>::default();
/// ```
///
/// [`BuildHasher`]: trait.BuildHasher.html
/// [`Default`]: ../default/trait.Default.html
/// [`Hasher`]: trait.Hasher.html
#[stable(since = "1.7.0", feature = "build_hasher")]
pub struct BuildHasherDefault<H>(marker::PhantomData<H>);

Expand Down
3 changes: 3 additions & 0 deletions src/librustc_back/target/aarch64_linux_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

use target::{Target, TargetOptions, TargetResult};

// See https://developer.android.com/ndk/guides/abis.html#arm64-v8a
// for target ABI requirements.

pub fn target() -> TargetResult {
let mut base = super::android_base::opts();
base.max_atomic_width = Some(128);
Expand Down
7 changes: 5 additions & 2 deletions src/librustc_back/target/armv7_linux_androideabi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,9 +10,12 @@

use target::{Target, TargetOptions, TargetResult};

// See https://developer.android.com/ndk/guides/abis.html#v7a
// for target ABI requirements.

pub fn target() -> TargetResult {
let mut base = super::android_base::opts();
base.features = "+v7,+thumb2,+vfp3,+d16".to_string();
base.features = "+v7,+thumb2,+vfp3,+d16,-neon".to_string();
base.max_atomic_width = Some(64);

Ok(Target {
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_back/target/i686_linux_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

use target::{Target, TargetResult};

// See https://developer.android.com/ndk/guides/abis.html#x86
// for target ABI requirements.

pub fn target() -> TargetResult {
let mut base = super::android_base::opts();

Expand Down
17 changes: 17 additions & 0 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,30 @@ impl Child {
/// this function at a known point where there are no more destructors left
/// to run.
///
/// ## Platform-specific behavior
///
/// **Unix**: On Unix-like platforms, it is unlikely that all 32 bits of `exit`
/// will be visible to a parent process inspecting the exit code. On most
/// Unix-like platforms, only the eight least-significant bits are considered.
///
/// # Examples
///
/// ```
/// use std::process;
///
/// process::exit(0);
/// ```
///
/// Due to [platform-specific behavior], the exit code for this example will be
/// `0` on Linux, but `256` on Windows:
///
/// ```no_run
/// use std::process;
///
/// process::exit(0x0f00);
/// ```
///
/// [platform-specific behavior]: #platform-specific-behavior
#[stable(feature = "rust1", since = "1.0.0")]
pub fn exit(code: i32) -> ! {
::sys_common::cleanup();
Expand Down
Loading