Skip to content

Commit

Permalink
Auto merge of #44380 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Rollup of 23 pull requests

- Successful merges: #44097, #44206, #44218, #44276, #44277, #44296, #44303, #44313, #44315, #44317, #44319, #44321, #44325, #44326, #44327, #44328, #44330, #44351, #44353, #44354, #44361, #44362, #44377
- Failed merges:
  • Loading branch information
bors committed Sep 7, 2017
2 parents 3681220 + 6667058 commit 05e3c96
Show file tree
Hide file tree
Showing 33 changed files with 559 additions and 83 deletions.
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Compatibility Notes
[`slice::sort_unstable_by_key`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable_by_key
[`slice::sort_unstable_by`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable_by
[`slice::sort_unstable`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable
[`ste::from_boxed_utf8_unchecked`]: https://doc.rust-lang.org/std/str/fn.from_boxed_utf8_unchecked.html
[`str::from_boxed_utf8_unchecked`]: https://doc.rust-lang.org/std/str/fn.from_boxed_utf8_unchecked.html
[`str::as_bytes_mut`]: https://doc.rust-lang.org/std/primitive.str.html#method.as_bytes_mut
[`str::from_utf8_mut`]: https://doc.rust-lang.org/std/str/fn.from_utf8_mut.html
[`str::from_utf8_unchecked_mut`]: https://doc.rust-lang.org/std/str/fn.from_utf8_unchecked_mut.html
Expand Down
10 changes: 5 additions & 5 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
# option to true.
#full-bootstrap = false

# Enable a build of the and extended rust tool set which is not only the
# compiler but also tools such as Cargo. This will also produce "combined
# installers" which are used to install Rust and Cargo together. This is
# disabled by default.
# Enable a build of the extended rust tool set which is not only the compiler
# but also tools such as Cargo. This will also produce "combined installers"
# which are used to install Rust and Cargo together. This is disabled by
# default.
#extended = false

# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
Expand All @@ -175,7 +175,7 @@
# script.
#configure-args = []

# Indicates that a local rebuild is ocurring instead of a full bootstrap,
# Indicates that a local rebuild is occurring instead of a full bootstrap,
# essentially skipping stage0 as the local compiler is recompiling itself again.
#local-rebuild = false

Expand Down
14 changes: 13 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ impl Step for Rustc {
// tiny morsel of metadata is used by rust-packaging
let version = build.rust_version();
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
if let Some(sha) = build.rust_sha() {
t!(t!(File::create(overlay.join("git-commit-hash"))).write_all(sha.as_bytes()));
}

// On MinGW we've got a few runtime DLL dependencies that we need to
// include. The first argument to this script is where to put these DLLs
Expand Down Expand Up @@ -844,6 +847,9 @@ impl Step for PlainSourceTarball {

// Create the version file
write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes());
if let Some(sha) = build.rust_sha() {
write_file(&plain_dst_src.join("git-commit-hash"), sha.as_bytes());
}

// If we're building from git sources, we need to vendor a complete distribution.
if build.rust_info.is_git() {
Expand Down Expand Up @@ -1157,14 +1163,20 @@ impl Step for Extended {
install(&build.src.join("LICENSE-MIT"), &overlay, 0o644);
let version = build.rust_version();
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
if let Some(sha) = build.rust_sha() {
t!(t!(File::create(overlay.join("git-commit-hash"))).write_all(sha.as_bytes()));
}
install(&etc.join("README.md"), &overlay, 0o644);

// When rust-std package split from rustc, we needed to ensure that during
// upgrades rustc was upgraded before rust-std. To avoid rustc clobbering
// the std files during uninstall. To do this ensure that rustc comes
// before rust-std in the list below.
let mut tarballs = vec![rustc_installer, cargo_installer, rls_installer,
analysis_installer, docs_installer, std_installer];
analysis_installer, std_installer];
if build.config.docs {
tarballs.push(docs_installer);
}
if target.contains("pc-windows-gnu") {
tarballs.push(mingw_installer.unwrap());
}
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ install!((self, builder, _config),
builder.ensure(dist::Src);
install_src(builder, self.stage);
}, ONLY_BUILD;
Rustc, "src/librustc", _config.extended, only_hosts: true, {
Rustc, "src/librustc", true, only_hosts: true, {
builder.ensure(dist::Rustc {
compiler: builder.compiler(self.stage, self.target),
});
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,11 @@ impl Build {
self.rust_info.version(self, channel::CFG_RELEASE_NUM)
}

/// Return the full commit hash
fn rust_sha(&self) -> Option<&str> {
self.rust_info.sha()
}

/// Returns the `a.b.c` version that the given package is at.
fn release_num(&self, package: &str) -> String {
let mut toml = String::new();
Expand Down
10 changes: 10 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ impl Step for Openssl {
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"sparc64-unknown-netbsd" => "BSD-sparc64",
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
"x86_64-linux-android" => "linux-x86_64",
"x86_64-unknown-freebsd" => "BSD-x86_64",
Expand All @@ -436,6 +437,15 @@ impl Step for Openssl {
configure.arg("-mandroid");
configure.arg("-fomit-frame-pointer");
}
if target == "sparc64-unknown-netbsd" {
// Need -m64 to get assembly generated correctly for sparc64.
configure.arg("-m64");
if build.build.contains("netbsd") {
// Disable sparc64 asm on NetBSD builders, it uses
// m4(1)'s -B flag, which NetBSD m4 does not support.
configure.arg("no-asm");
}
}
// Make PIE binaries
// Non-PIE linker support was removed in Lollipop
// https://source.android.com/security/enhancements/enhancements50
Expand Down
63 changes: 63 additions & 0 deletions src/etc/platform-intrinsics/powerpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,69 @@
"llvm": "vupkh{1.kind}{1.data_type_short}",
"ret": "s(16-32)",
"args": ["0N"]
},
{
"intrinsic": "madds",
"width": [128],
"llvm": "vmhaddshs",
"ret": "s16",
"args": ["0", "0", "0"]
},
{
"intrinsic": "msumu{1.data_type_short}m",
"width": [128],
"llvm": "vmsumu{1.data_type_short}m",
"ret": "u32",
"args": ["u(8-16)", "1", "u32"]
},
{
"intrinsic": "msummbm",
"width": [128],
"llvm": "vmsummbm",
"ret": "s32",
"args": ["s8", "u8", "s32"]
},
{
"intrinsic": "msumshm",
"width": [128],
"llvm": "vmsumshm",
"ret": "s32",
"args": ["s16", "s16", "s32"]
},
{
"intrinsic": "msum{0.kind}hs",
"width": [128],
"llvm": "vmsum{0.kind}hs",
"ret": "i32",
"args": ["0N", "0N", "0"]
},
{
"intrinsic": "sum2s",
"width": [128],
"llvm": "vsum2sws",
"ret": "s32",
"args": ["0", "0"]
},
{
"intrinsic": "sum4{0.kind}bs",
"width": [128],
"llvm": "vsum4{0.kind}bs",
"ret": "i32",
"args": ["0NN", "0"]
},
{
"intrinsic": "sum4shs",
"width": [128],
"llvm": "vsum4shs",
"ret": "s32",
"args": ["0N", "0"]
},
{
"intrinsic": "sums",
"width": [128],
"llvm": "vsumsws",
"ret": "s32",
"args": ["0", "0"]
}
]
}
45 changes: 25 additions & 20 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,25 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// let v = [10, 40, 30, 20, 50];
/// let (v1, v2) = v.split_at(2);
/// assert_eq!([10, 40], v1);
/// assert_eq!([30, 20, 50], v2);
/// let v = [1, 2, 3, 4, 5, 6];
///
/// {
/// let (left, right) = v.split_at(0);
/// assert!(left == []);
/// assert!(right == [1, 2, 3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at(2);
/// assert!(left == [1, 2]);
/// assert!(right == [3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at(6);
/// assert!(left == [1, 2, 3, 4, 5, 6]);
/// assert!(right == []);
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand All @@ -695,26 +710,16 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// let mut v = [1, 2, 3, 4, 5, 6];
///
/// let mut v = [1, 0, 3, 0, 5, 6];
/// // scoped to restrict the lifetime of the borrows
/// {
/// let (left, right) = v.split_at_mut(0);
/// assert!(left == []);
/// assert!(right == [1, 2, 3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at_mut(2);
/// assert!(left == [1, 2]);
/// assert!(right == [3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at_mut(6);
/// assert!(left == [1, 2, 3, 4, 5, 6]);
/// assert!(right == []);
/// assert!(left == [1, 0]);
/// assert!(right == [3, 0, 5, 6]);
/// left[1] = 2;
/// right[1] = 4;
/// }
/// assert!(v == [1, 2, 3, 4, 5, 6]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand Down
24 changes: 24 additions & 0 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,30 @@ pub trait Ord: Eq + PartialOrd<Self> {
where Self: Sized {
if self <= other { self } else { other }
}

/// Returns max if self is greater than max, and min if self is less than min.
/// Otherwise this will return self.
///
/// # Examples
///
/// ```
/// #![feature(clamp)]
///
/// assert!((-3).clamp(-2, 1) == -2);
/// assert!(0.clamp(-2, 1) == 0);
/// assert!(2.clamp(-2, 1) == 1);
/// ```
///
/// # Panics
/// Panics if min > max.
#[unstable(feature = "clamp", issue = "44095")]
fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized {
assert!(min <= max);
if self < min { min }
else if self > max { max }
else { self }
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
4 changes: 1 addition & 3 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,13 @@ macro_rules! unreachable {

/// A standardized placeholder for marking unfinished code.
///
/// It panics with the message `"not yet implemented"` when executed.
///
/// This can be useful if you are prototyping and are just looking to have your
/// code typecheck, or if you're implementing a trait that requires multiple
/// methods, and you're only planning on using one of them.
///
/// # Panics
///
/// This macro always panics.
/// This will always [panic!](macro.panic.html)
///
/// # Examples
///
Expand Down
1 change: 0 additions & 1 deletion src/libcore/num/dec2flt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ macro_rules! from_str_float_impl {
/// * '-3.14'
/// * '2.5E10', or equivalently, '2.5e10'
/// * '2.5E-10'
/// * '.' (understood as 0)
/// * '5.'
/// * '.5', or, equivalently, '0.5'
/// * 'inf', '-inf', 'NaN'
Expand Down
11 changes: 10 additions & 1 deletion src/librustc/hir/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,19 @@ impl serialize::UseSpecializedDecodable for CrateNum {
///
/// Since the DefIndex is mostly treated as an opaque ID, you probably
/// don't have to care about these ranges.
#[derive(Clone, Debug, Eq, Ord, PartialOrd, PartialEq, RustcEncodable,
#[derive(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable,
RustcDecodable, Hash, Copy)]
pub struct DefIndex(u32);

impl fmt::Debug for DefIndex {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"DefIndex({}:{})",
self.address_space().index(),
self.as_array_index())
}
}

impl DefIndex {
#[inline]
pub fn new(x: usize) -> DefIndex {
Expand Down
10 changes: 8 additions & 2 deletions src/librustc_mir/transform/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,20 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> {
_location: Location) {
if *local == RETURN_POINTER {
match self.destination {
Lvalue::Local(l) => *local = l,
Lvalue::Local(l) => {
*local = l;
return;
},
ref lval => bug!("Return lvalue is {:?}, not local", lval)
}
}
let idx = local.index() - 1;
if idx < self.args.len() {
match self.args[idx] {
Operand::Consume(Lvalue::Local(l)) => *local = l,
Operand::Consume(Lvalue::Local(l)) => {
*local = l;
return;
},
ref op => bug!("Arg operand `{:?}` is {:?}, not local", idx, op)
}
}
Expand Down
Loading

0 comments on commit 05e3c96

Please sign in to comment.