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

Closed
wants to merge 20 commits into from
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
24834eb
rustc: Set release mode cgus to 16 by default
alexcrichton Dec 21, 2017
c026d19
Add a feature gate for nested uses of `impl Trait`
cramertj Dec 20, 2017
de46292
Add LLVM `minnum`/`maxnum` intrinsics
varkor Dec 21, 2017
20eece1
Correct the return type for `x86_mm256_sad_epu8`
varkor Dec 21, 2017
a060814
Add comments to bootstrapping `minnum`/`maxnum`
varkor Dec 21, 2017
8a956e4
Clarify docs for split_at_mut
lucis-fluxum Dec 21, 2017
ebdd667
Make core::f32/f64 docs match std.
Dec 22, 2017
4e14a7d
Fixing Rust Moderation Team link
davidalber Dec 22, 2017
0e703ed
Add support for CloudABI targets to the rustc backend.
EdSchouten Dec 22, 2017
4156752
Add CloudABI to the list of supported targets.
EdSchouten Dec 22, 2017
dc71cab
Fix process test when using busybox mkdir
malbarbo Dec 22, 2017
642d9a5
Rollup merge of #46888 - cramertj:nested-impl-trait-error, r=nikomats…
kennytm Dec 23, 2017
f196e9b
Rollup merge of #46910 - alexcrichton:thinlto-default, r=michaelwoeri…
kennytm Dec 23, 2017
5d9fe6f
Rollup merge of #46926 - varkor:contrib-9, r=joshtriplett
kennytm Dec 23, 2017
26d7471
Rollup merge of #46928 - varkor:contrib-10, r=alexcrichton
kennytm Dec 23, 2017
089e617
Rollup merge of #46930 - lucis-fluxum:patch-1, r=QuietMisdreavus
kennytm Dec 23, 2017
b4fe39b
Rollup merge of #46933 - clarcharr:float_docs, r=steveklabnik
kennytm Dec 23, 2017
1a39267
Rollup merge of #46939 - davidalber:code-of-conduct-mod-team-link, r=…
kennytm Dec 23, 2017
543dabb
Rollup merge of #46940 - EdSchouten:cloudabi, r=alexcrichton
kennytm Dec 23, 2017
18047cf
Rollup merge of #46943 - malbarbo:process-test-busybox, r=alexcrichton
kennytm Dec 23, 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
6 changes: 4 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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.
* 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.
* 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.

## 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.)
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.

*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
2 changes: 1 addition & 1 deletion src/etc/platform-intrinsics/x86/avx2.json
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@
"intrinsic": "256_sad_epu8",
"width": [256],
"llvm": "psad.bw",
"ret": "u8",
"ret": "u64",
"args": ["0", "0"]
},
{
2 changes: 1 addition & 1 deletion src/liballoc/slice.rs
Original file line number Diff line number Diff line change
@@ -699,7 +699,7 @@ impl<T> [T] {
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 index `mid` itself) and the second will contain all
54 changes: 54 additions & 0 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -1142,6 +1142,19 @@ extern "rust-intrinsic" {
/// Returns the absolute value of an `f64`.
pub fn fabsf64(x: f64) -> f64;

/// Returns the minimum of two `f32` values.
#[cfg(not(stage0))]
pub fn minnumf32(x: f32, y: f32) -> f32;
/// Returns the minimum of two `f64` values.
#[cfg(not(stage0))]
pub fn minnumf64(x: f64, y: f64) -> f64;
/// Returns the maximum of two `f32` values.
#[cfg(not(stage0))]
pub fn maxnumf32(x: f32, y: f32) -> f32;
/// Returns the maximum of two `f64` values.
#[cfg(not(stage0))]
pub fn maxnumf64(x: f64, y: f64) -> f64;

/// Copies the sign from `y` to `x` for `f32` values.
pub fn copysignf32(x: f32, y: f32) -> f32;
/// Copies the sign from `y` to `x` for `f64` values.
@@ -1393,3 +1406,44 @@ extern "rust-intrinsic" {
#[cfg(not(stage0))]
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
}

// Simple bootstrap implementations for stage0 compilation

/// Returns the minimum of two `f32` values.
#[cfg(stage0)]
pub unsafe fn minnumf32(x: f32, y: f32) -> f32 {
// IEEE754 says: minNum(x, y) is the canonicalized number x if x < y, y if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signalingNaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if x < y || y != y { x } else { y }) * 1.0
}
/// Returns the minimum of two `f64` values.
#[cfg(stage0)]
pub unsafe fn minnumf64(x: f64, y: f64) -> f64 {
// Identical to the `f32` case.
(if x < y || y != y { x } else { y }) * 1.0
}
/// Returns the maximum of two `f32` values.
#[cfg(stage0)]
pub unsafe fn maxnumf32(x: f32, y: f32) -> f32 {
// IEEE754 says: maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signalingNaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if x < y || x != x { y } else { x }) * 1.0
}
/// Returns the maximum of two `f64` values.
#[cfg(stage0)]
pub unsafe fn maxnumf64(x: f64, y: f64) -> f64 {
// Identical to the `f32` case.
(if x < y || x != x { y } else { x }) * 1.0
}
27 changes: 8 additions & 19 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,12 @@
// option. This file may not be copied, modified, or distributed
// 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")]

@@ -250,28 +255,12 @@ impl Float for f32 {
/// Returns the maximum of the two numbers.
#[inline]
fn max(self, other: f32) -> f32 {
// IEEE754 says: maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signalingNaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if self < other || self.is_nan() { other } else { self }) * 1.0
unsafe { intrinsics::maxnumf32(self, other) }
}

/// Returns the minimum of the two numbers.
#[inline]
fn min(self, other: f32) -> f32 {
// IEEE754 says: minNum(x, y) is the canonicalized number x if x < y, y if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signalingNaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if self < other || other.is_nan() { self } else { other }) * 1.0
unsafe { intrinsics::minnumf32(self, other) }
}
}
27 changes: 8 additions & 19 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,12 @@
// option. This file may not be copied, modified, or distributed
// 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")]

@@ -248,28 +253,12 @@ impl Float for f64 {
/// Returns the maximum of the two numbers.
#[inline]
fn max(self, other: f64) -> f64 {
// IEEE754 says: maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signalingNaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if self < other || self.is_nan() { other } else { self }) * 1.0
unsafe { intrinsics::maxnumf64(self, other) }
}

/// Returns the minimum of the two numbers.
#[inline]
fn min(self, other: f64) -> f64 {
// IEEE754 says: minNum(x, y) is the canonicalized number x if x < y, y if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signalingNaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if self < other || other.is_nan() { self } else { other }) * 1.0
unsafe { intrinsics::minnumf64(self, other) }
}
}
5 changes: 1 addition & 4 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
@@ -791,10 +791,7 @@ impl Session {
// As a result 16 was chosen here! Mostly because it was a power of 2
// and most benchmarks agreed it was roughly a local optimum. Not very
// scientific.
match self.opts.optimize {
config::OptLevel::No => 16,
_ => 1, // FIXME(#46346) this should be 16
}
16
}

/// Returns whether ThinLTO is enabled for this compilation
32 changes: 32 additions & 0 deletions src/librustc_back/target/aarch64_unknown_cloudabi.rs
Original file line number Diff line number Diff line change
@@ -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,
})
}
34 changes: 34 additions & 0 deletions src/librustc_back/target/armv7_unknown_cloudabi_eabihf.rs
Original file line number Diff line number Diff line change
@@ -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,
})
}
34 changes: 34 additions & 0 deletions src/librustc_back/target/cloudabi_base.rs
Original file line number Diff line number Diff line change
@@ -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()
}
}
34 changes: 34 additions & 0 deletions src/librustc_back/target/i686_unknown_cloudabi.rs
Original file line number Diff line number Diff line change
@@ -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,
})
}
6 changes: 6 additions & 0 deletions src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ mod apple_base;
mod apple_ios_base;
mod arm_base;
mod bitrig_base;
mod cloudabi_base;
mod dragonfly_base;
mod emscripten_base;
mod freebsd_base;
@@ -227,6 +228,11 @@ supported_targets! {
("thumbv7em-none-eabihf", thumbv7em_none_eabihf),

("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.
34 changes: 34 additions & 0 deletions src/librustc_back/target/x86_64_unknown_cloudabi.rs
Original file line number Diff line number Diff line change
@@ -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,
})
}
Loading