Auto merge of #47012 - kennytm:rollup, r=kennytm

Rollup of 8 pull requests

- Successful merges: #46928, #46930, #46933, #46939, #46940, #46943, #46979, #46986
- Failed merges:
This commit is contained in:
bors 2017-12-26 08:33:23 +00:00
commit 8cdde6db71
18 changed files with 212 additions and 14 deletions

View file

@ -12,13 +12,13 @@ A version of this document [can be found online](https://www.rust-lang.org/condu
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer. * Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works. * Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour. We interpret the term "harassment" as including the definition in the <a href="http://citizencodeofconduct.org/">Citizen Code of Conduct</a>; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups. * We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour. We interpret the term "harassment" as including the definition in the <a href="http://citizencodeofconduct.org/">Citizen Code of Conduct</a>; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Rust moderation team](/team.html#Moderation) immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back. * Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Rust moderation team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome. * Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome.
## Moderation ## Moderation
These are the policies for upholding our community's standards of conduct. If you feel that a thread needs moderation, please contact the [Rust moderation team](/team.html#Moderation). These are the policies for upholding our community's standards of conduct. If you feel that a thread needs moderation, please contact the [Rust moderation team][mod_team].
1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.) 1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed. 2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
@ -36,3 +36,5 @@ And if someone takes issue with something you said or did, resist the urge to be
The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion. The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/).* *Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/).*
[mod_team]: https://www.rust-lang.org/team.html#Moderation-team

View file

@ -174,7 +174,7 @@
"intrinsic": "256_sad_epu8", "intrinsic": "256_sad_epu8",
"width": [256], "width": [256],
"llvm": "psad.bw", "llvm": "psad.bw",
"ret": "u8", "ret": "u64",
"args": ["0", "0"] "args": ["0", "0"]
}, },
{ {

View file

@ -699,7 +699,7 @@ impl<T> [T] {
core_slice::SliceExt::split_at(self, mid) core_slice::SliceExt::split_at(self, mid)
} }
/// Divides one `&mut` into two at an index. /// Divides one mutable slice into two at an index.
/// ///
/// The first will contain all indices from `[0, mid)` (excluding /// The first will contain all indices from `[0, mid)` (excluding
/// the index `mid` itself) and the second will contain all /// the index `mid` itself) and the second will contain all

View file

@ -8,7 +8,12 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
//! Operations and constants for 32-bits floats (`f32` type) //! This module provides constants which are specific to the implementation
//! of the `f32` floating point data type.
//!
//! Mathematically significant numbers are provided in the `consts` sub-module.
//!
//! *[See also the `f32` primitive type](../../std/primitive.f32.html).*
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]

View file

@ -8,7 +8,12 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
//! Operations and constants for 64-bits floats (`f64` type) //! This module provides constants which are specific to the implementation
//! of the `f64` floating point data type.
//!
//! Mathematically significant numbers are provided in the `consts` sub-module.
//!
//! *[See also the `f64` primitive type](../../std/primitive.f64.html).*
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]

View file

@ -103,6 +103,8 @@ macro_rules! int_impl {
/// ///
/// # Examples /// # Examples
/// ///
/// Basic usage:
///
/// ``` /// ```
/// assert_eq!(i8::min_value(), -128); /// assert_eq!(i8::min_value(), -128);
/// ``` /// ```
@ -116,6 +118,8 @@ macro_rules! int_impl {
/// ///
/// # Examples /// # Examples
/// ///
/// Basic usage:
///
/// ``` /// ```
/// assert_eq!(i8::max_value(), 127); /// assert_eq!(i8::max_value(), 127);
/// ``` /// ```
@ -1252,6 +1256,8 @@ macro_rules! uint_impl {
/// ///
/// # Examples /// # Examples
/// ///
/// Basic usage:
///
/// ``` /// ```
/// assert_eq!(u8::min_value(), 0); /// assert_eq!(u8::min_value(), 0);
/// ``` /// ```
@ -1263,6 +1269,8 @@ macro_rules! uint_impl {
/// ///
/// # Examples /// # Examples
/// ///
/// Basic usage:
///
/// ``` /// ```
/// assert_eq!(u8::max_value(), 255); /// assert_eq!(u8::max_value(), 255);
/// ``` /// ```

View file

@ -1896,7 +1896,7 @@ pub struct GeneratorLayout<'tcx> {
/// ///
/// Example: If type check produces a closure with the closure substs: /// Example: If type check produces a closure with the closure substs:
/// ///
/// ``` /// ```text
/// ClosureSubsts = [ /// ClosureSubsts = [
/// i8, // the "closure kind" /// i8, // the "closure kind"
/// for<'x> fn(&'a &'x u32) -> &'x u32, // the "closure signature" /// for<'x> fn(&'a &'x u32) -> &'x u32, // the "closure signature"
@ -1907,7 +1907,7 @@ pub struct GeneratorLayout<'tcx> {
/// here, there is one unique free region (`'a`) but it appears /// here, there is one unique free region (`'a`) but it appears
/// twice. We would "renumber" each occurence to a unique vid, as follows: /// twice. We would "renumber" each occurence to a unique vid, as follows:
/// ///
/// ``` /// ```text
/// ClosureSubsts = [ /// ClosureSubsts = [
/// i8, // the "closure kind" /// i8, // the "closure kind"
/// for<'x> fn(&'1 &'x u32) -> &'x u32, // the "closure signature" /// for<'x> fn(&'1 &'x u32) -> &'x u32, // the "closure signature"

View file

@ -0,0 +1,32 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use LinkerFlavor;
use target::{Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::cloudabi_base::opts();
base.max_atomic_width = Some(128);
base.abi_blacklist = super::arm_base::abi_blacklist();
Ok(Target {
llvm_target: "aarch64-unknown-cloudabi".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
arch: "aarch64".to_string(),
target_os: "cloudabi".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}

View file

@ -0,0 +1,34 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use LinkerFlavor;
use target::{Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::cloudabi_base::opts();
base.cpu = "cortex-a8".to_string();
base.max_atomic_width = Some(64);
base.features = "+v7,+vfp3,+neon".to_string();
base.abi_blacklist = super::arm_base::abi_blacklist();
Ok(Target {
llvm_target: "armv7-unknown-cloudabi-eabihf".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
arch: "arm".to_string(),
target_os: "cloudabi".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}

View file

@ -0,0 +1,34 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use LinkerFlavor;
use target::{LinkArgs, TargetOptions, RelroLevel};
use std::default::Default;
pub fn opts() -> TargetOptions {
let mut args = LinkArgs::new();
args.insert(LinkerFlavor::Gcc, vec![
"-Wl,-Bstatic".to_string(),
"-Wl,--no-dynamic-linker".to_string(),
"-Wl,--eh-frame-hdr".to_string(),
"-Wl,--gc-sections".to_string(),
]);
TargetOptions {
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
pre_link_args: args,
position_independent_executables: true,
relro_level: RelroLevel::Full,
exe_allocation_crate: super::maybe_jemalloc(),
.. Default::default()
}
}

View file

@ -0,0 +1,34 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use LinkerFlavor;
use target::{Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::cloudabi_base::opts();
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
base.stack_probes = true;
Ok(Target {
llvm_target: "i686-unknown-cloudabi".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
arch: "x86".to_string(),
target_os: "cloudabi".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}

View file

@ -57,6 +57,7 @@ mod apple_base;
mod apple_ios_base; mod apple_ios_base;
mod arm_base; mod arm_base;
mod bitrig_base; mod bitrig_base;
mod cloudabi_base;
mod dragonfly_base; mod dragonfly_base;
mod emscripten_base; mod emscripten_base;
mod freebsd_base; mod freebsd_base;
@ -227,6 +228,11 @@ supported_targets! {
("thumbv7em-none-eabihf", thumbv7em_none_eabihf), ("thumbv7em-none-eabihf", thumbv7em_none_eabihf),
("msp430-none-elf", msp430_none_elf), ("msp430-none-elf", msp430_none_elf),
("aarch64-unknown-cloudabi", aarch64_unknown_cloudabi),
("armv7-unknown-cloudabi-eabihf", armv7_unknown_cloudabi_eabihf),
("i686-unknown-cloudabi", i686_unknown_cloudabi),
("x86_64-unknown-cloudabi", x86_64_unknown_cloudabi),
} }
/// Everything `rustc` knows about how to compile for a specific target. /// Everything `rustc` knows about how to compile for a specific target.

View file

@ -0,0 +1,34 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use LinkerFlavor;
use target::{Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::cloudabi_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.stack_probes = true;
Ok(Target {
llvm_target: "x86_64-unknown-cloudabi".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
arch: "x86_64".to_string(),
target_os: "cloudabi".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}

View file

@ -354,7 +354,7 @@ pub fn find(name: &str) -> Option<Intrinsic> {
}, },
"_mm256_sad_epu8" => Intrinsic { "_mm256_sad_epu8" => Intrinsic {
inputs: { static INPUTS: [&'static Type; 2] = [&::U8x32, &::U8x32]; &INPUTS }, inputs: { static INPUTS: [&'static Type; 2] = [&::U8x32, &::U8x32]; &INPUTS },
output: &::U8x32, output: &::U64x4,
definition: Named("llvm.x86.avx2.psad.bw") definition: Named("llvm.x86.avx2.psad.bw")
}, },
"_mm256_shuffle_epi8" => Intrinsic { "_mm256_shuffle_epi8" => Intrinsic {

View file

@ -13,7 +13,7 @@
//! //!
//! Mathematically significant numbers are provided in the `consts` sub-module. //! Mathematically significant numbers are provided in the `consts` sub-module.
//! //!
//! *[See also the `f32` primitive type](../primitive.f32.html).* //! *[See also the `f32` primitive type](../../std/primitive.f32.html).*
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]
#![allow(missing_docs)] #![allow(missing_docs)]

View file

@ -13,7 +13,7 @@
//! //!
//! Mathematically significant numbers are provided in the `consts` sub-module. //! Mathematically significant numbers are provided in the `consts` sub-module.
//! //!
//! *[See also the `f64` primitive type](../primitive.f64.html).* //! *[See also the `f64` primitive type](../../std/primitive.f64.html).*
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]
#![allow(missing_docs)] #![allow(missing_docs)]

View file

@ -1584,7 +1584,7 @@ mod tests {
= if cfg!(target_os = "windows") { = if cfg!(target_os = "windows") {
Command::new("cmd").args(&["/C", "mkdir ."]).output().unwrap() Command::new("cmd").args(&["/C", "mkdir ."]).output().unwrap()
} else { } else {
Command::new("mkdir").arg(".").output().unwrap() Command::new("mkdir").arg("./").output().unwrap()
}; };
assert!(status.code() == Some(1)); assert!(status.code() == Some(1));

View file

@ -46,8 +46,9 @@ static HOSTS: &'static [&'static str] = &[
static TARGETS: &'static [&'static str] = &[ static TARGETS: &'static [&'static str] = &[
"aarch64-apple-ios", "aarch64-apple-ios",
"aarch64-unknown-fuchsia",
"aarch64-linux-android", "aarch64-linux-android",
"aarch64-unknown-cloudabi",
"aarch64-unknown-fuchsia",
"aarch64-unknown-linux-gnu", "aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl", "aarch64-unknown-linux-musl",
"arm-linux-androideabi", "arm-linux-androideabi",
@ -58,6 +59,7 @@ static TARGETS: &'static [&'static str] = &[
"armv5te-unknown-linux-gnueabi", "armv5te-unknown-linux-gnueabi",
"armv7-apple-ios", "armv7-apple-ios",
"armv7-linux-androideabi", "armv7-linux-androideabi",
"armv7-unknown-cloudabi-eabihf",
"armv7-unknown-linux-gnueabihf", "armv7-unknown-linux-gnueabihf",
"armv7-unknown-linux-musleabihf", "armv7-unknown-linux-musleabihf",
"armv7s-apple-ios", "armv7s-apple-ios",
@ -69,6 +71,7 @@ static TARGETS: &'static [&'static str] = &[
"i686-linux-android", "i686-linux-android",
"i686-pc-windows-gnu", "i686-pc-windows-gnu",
"i686-pc-windows-msvc", "i686-pc-windows-msvc",
"i686-unknown-cloudabi",
"i686-unknown-freebsd", "i686-unknown-freebsd",
"i686-unknown-linux-gnu", "i686-unknown-linux-gnu",
"i686-unknown-linux-musl", "i686-unknown-linux-musl",
@ -86,13 +89,14 @@ static TARGETS: &'static [&'static str] = &[
"sparcv9-sun-solaris", "sparcv9-sun-solaris",
"wasm32-unknown-emscripten", "wasm32-unknown-emscripten",
"wasm32-unknown-unknown", "wasm32-unknown-unknown",
"x86_64-linux-android",
"x86_64-apple-darwin", "x86_64-apple-darwin",
"x86_64-apple-ios", "x86_64-apple-ios",
"x86_64-linux-android",
"x86_64-pc-windows-gnu", "x86_64-pc-windows-gnu",
"x86_64-pc-windows-msvc", "x86_64-pc-windows-msvc",
"x86_64-rumprun-netbsd", "x86_64-rumprun-netbsd",
"x86_64-sun-solaris", "x86_64-sun-solaris",
"x86_64-unknown-cloudabi",
"x86_64-unknown-freebsd", "x86_64-unknown-freebsd",
"x86_64-unknown-fuchsia", "x86_64-unknown-fuchsia",
"x86_64-unknown-linux-gnu", "x86_64-unknown-linux-gnu",