Skip to content

Commit

Permalink
Auto merge of #47392 - kennytm:rollup, r=kennytm
Browse files Browse the repository at this point in the history
Rollup of 24 pull requests

- Successful merges: #46985, #47069, #47081, #47185, #47282, #47283, #47288, #47289, #47298, #47305, #47306, #47307, #47310, #47324, #47328, #47331, #47340, #47343, #47344, #47352, #47357, #47365, #47375, #47382
- Failed merges: #47334
  • Loading branch information
bors committed Jan 12, 2018
2 parents 0b90e4e + c12eabf commit 51b0b37
Show file tree
Hide file tree
Showing 57 changed files with 490 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ matrix:
if: branch = auto
- env: IMAGE=dist-armv7-linux DEPLOY=1
if: branch = auto
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
- env: IMAGE=dist-i586-gnu-i586-i686-musl DEPLOY=1
if: branch = auto
- env: IMAGE=dist-i686-freebsd DEPLOY=1
if: branch = auto
Expand Down
10 changes: 5 additions & 5 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def v(*args):
"MUSL root installation directory (deprecated)")
v("musl-root-x86_64", "target.x86_64-unknown-linux-musl.musl-root",
"x86_64-unknown-linux-musl install directory")
v("musl-root-i586", "target.i586-unknown-linux-musl.musl-root",
"i586-unknown-linux-musl install directory")
v("musl-root-i686", "target.i686-unknown-linux-musl.musl-root",
"i686-unknown-linux-musl install directory")
v("musl-root-arm", "target.arm-unknown-linux-musleabi.musl-root",
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ impl Step for Openssl {
"arm-unknown-linux-gnueabihf" => "linux-armv4",
"armv7-linux-androideabi" => "android-armv7",
"armv7-unknown-linux-gnueabihf" => "linux-armv4",
"i586-unknown-linux-gnu" => "linux-elf",
"i586-unknown-linux-musl" => "linux-elf",
"i686-apple-darwin" => "darwin-i386-cc",
"i686-linux-android" => "android-x86",
"i686-unknown-freebsd" => "BSD-x86-elf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ COPY scripts/musl.sh /build/
RUN CC=gcc CFLAGS="-m32 -fPIC -Wa,-mrelax-relocations=no" \
CXX=g++ CXXFLAGS="-m32 -Wa,-mrelax-relocations=no" \
bash musl.sh i686 --target=i686 && \
CC=gcc CFLAGS="-march=pentium -m32 -fPIC -Wa,-mrelax-relocations=no" \
CXX=g++ CXXFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \
bash musl.sh i586 --target=i586 && \
rm -rf /build

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS \
--target=i686-unknown-linux-musl,i586-unknown-linux-gnu \
--musl-root-i586=/musl-i586 \
--musl-root-i686=/musl-i686 \
--enable-extended

Expand All @@ -38,12 +42,13 @@ ENV RUST_CONFIGURE_ARGS \
# See: https://github.com/rust-lang/rust/issues/34978
ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no
ENV CFLAGS_i586_unknown_linux_gnu=-Wa,-mrelax-relocations=no
# FIXME remove -Wl,-melf_i386 after cc is updated to include
# https://github.com/alexcrichton/cc-rs/pull/281
ENV CFLAGS_i586_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wl,-melf_i386"

ENV TARGETS=i586-unknown-linux-gnu
ENV TARGETS=$TARGETS,i686-unknown-linux-musl

ENV SCRIPT \
python2.7 ../x.py test \
--target i686-unknown-linux-musl \
--target i586-unknown-linux-gnu \
&& \
python2.7 ../x.py dist \
--target i686-unknown-linux-musl \
--target i586-unknown-linux-gnu
python2.7 ../x.py test --target $TARGETS && \
python2.7 ../x.py dist --target $TARGETS,i586-unknown-linux-musl
4 changes: 2 additions & 2 deletions src/ci/docker/scripts/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exit 1
TAG=$1
shift

MUSL=musl-1.1.17
MUSL=musl-1.1.18

# may have been downloaded in a previous run
if [ ! -d $MUSL ]; then
Expand All @@ -39,7 +39,7 @@ fi

cd $MUSL
./configure --disable-shared --prefix=/musl-$TAG $@
if [ "$TAG" = "i686" ]; then
if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
hide_output make -j$(nproc) AR=ar RANLIB=ranlib
else
hide_output make -j$(nproc)
Expand Down
35 changes: 24 additions & 11 deletions src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ struct TypedArenaChunk<T> {
impl<T> TypedArenaChunk<T> {
#[inline]
unsafe fn new(capacity: usize) -> TypedArenaChunk<T> {
TypedArenaChunk { storage: RawVec::with_capacity(capacity) }
TypedArenaChunk {
storage: RawVec::with_capacity(capacity),
}
}

/// Destroys this arena chunk.
Expand Down Expand Up @@ -132,7 +134,9 @@ impl<T> TypedArena<T> {

unsafe {
if mem::size_of::<T>() == 0 {
self.ptr.set(intrinsics::arith_offset(self.ptr.get() as *mut u8, 1) as *mut T);
self.ptr
.set(intrinsics::arith_offset(self.ptr.get() as *mut u8, 1)
as *mut T);
let ptr = mem::align_of::<T>() as *mut T;
// Don't drop the object. This `write` is equivalent to `forget`.
ptr::write(ptr, object);
Expand All @@ -157,7 +161,9 @@ impl<T> TypedArena<T> {
/// - Zero-length slices
#[inline]
pub fn alloc_slice(&self, slice: &[T]) -> &mut [T]
where T: Copy {
where
T: Copy,
{
assert!(mem::size_of::<T>() != 0);
assert!(slice.len() != 0);

Expand Down Expand Up @@ -321,7 +327,10 @@ impl DroplessArena {
let (chunk, mut new_capacity);
if let Some(last_chunk) = chunks.last_mut() {
let used_bytes = self.ptr.get() as usize - last_chunk.start() as usize;
if last_chunk.storage.reserve_in_place(used_bytes, needed_bytes) {
if last_chunk
.storage
.reserve_in_place(used_bytes, needed_bytes)
{
self.end.set(last_chunk.end());
return;
} else {
Expand Down Expand Up @@ -357,9 +366,9 @@ impl DroplessArena {

let ptr = self.ptr.get();
// Set the pointer past ourselves
self.ptr.set(intrinsics::arith_offset(
self.ptr.get(), mem::size_of::<T>() as isize
) as *mut u8);
self.ptr.set(
intrinsics::arith_offset(self.ptr.get(), mem::size_of::<T>() as isize) as *mut u8,
);
// Write into uninitialized memory.
ptr::write(ptr as *mut T, object);
&mut *(ptr as *mut T)
Expand All @@ -375,7 +384,9 @@ impl DroplessArena {
/// - Zero-length slices
#[inline]
pub fn alloc_slice<T>(&self, slice: &[T]) -> &mut [T]
where T: Copy {
where
T: Copy,
{
assert!(!mem::needs_drop::<T>());
assert!(mem::size_of::<T>() != 0);
assert!(slice.len() != 0);
Expand All @@ -391,7 +402,8 @@ impl DroplessArena {
unsafe {
let arena_slice = slice::from_raw_parts_mut(self.ptr.get() as *mut T, slice.len());
self.ptr.set(intrinsics::arith_offset(
self.ptr.get(), (slice.len() * mem::size_of::<T>()) as isize
self.ptr.get(),
(slice.len() * mem::size_of::<T>()) as isize,
) as *mut u8);
arena_slice.copy_from_slice(slice);
arena_slice
Expand Down Expand Up @@ -456,8 +468,9 @@ mod tests {

let arena = Wrap(TypedArena::new());

let result =
arena.alloc_outer(|| Outer { inner: arena.alloc_inner(|| Inner { value: 10 }) });
let result = arena.alloc_outer(|| Outer {
inner: arena.alloc_inner(|| Inner { value: 10 }),
});

assert_eq!(result.inner.value, 10);
}
Expand Down
1 change: 0 additions & 1 deletion src/libcore/tests/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ test_impl_from! { test_u16f64, u16, f64 }
test_impl_from! { test_u32f64, u32, f64 }

// Float -> Float
#[cfg_attr(all(target_arch = "wasm32", target_os = "emscripten"), ignore)] // issue 42630
#[test]
fn test_f32f64() {
use core::f32;
Expand Down
1 change: 1 addition & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#![feature(drain_filter)]
#![feature(dyn_trait)]
#![feature(from_ref)]
#![feature(fs_read_write)]
#![feature(i128)]
#![feature(i128_type)]
#![feature(inclusive_range)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ pub fn check_ast_crate(sess: &Session, krate: &ast::Crate) {
// calculated the lint levels for all AST nodes.
for (_id, lints) in cx.buffered.map {
for early_lint in lints {
span_bug!(early_lint.span, "failed to process bufferd lint here");
span_bug!(early_lint.span, "failed to process buffered lint here");
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions src/librustc/util/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,10 @@ pub fn record_time<T, F>(accu: &Cell<Duration>, f: F) -> T where
// Memory reporting
#[cfg(unix)]
fn get_resident() -> Option<usize> {
use std::fs::File;
use std::io::Read;
use std::fs;

let field = 1;
let mut f = File::open("/proc/self/statm").ok()?;
let mut contents = String::new();
f.read_to_string(&mut contents).ok()?;
let contents = fs::read_string("/proc/self/statm").ok()?;
let s = contents.split_whitespace().nth(field)?;
let npages = s.parse::<usize>().ok()?;
Some(npages * 4096)
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#![feature(box_syntax)]
#![feature(const_fn)]
#![feature(fs_read_write)]

extern crate syntax;
extern crate rand;
Expand Down
18 changes: 18 additions & 0 deletions src/librustc_back/target/i586_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2014 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 target::TargetResult;

pub fn target() -> TargetResult {
let mut base = super::i686_unknown_linux_musl::target()?;
base.options.cpu = "pentium".to_string();
base.llvm_target = "i586-unknown-linux-musl".to_string();
Ok(base)
}
13 changes: 6 additions & 7 deletions src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
use serialize::json::{Json, ToJson};
use std::collections::BTreeMap;
use std::default::Default;
use std::io::prelude::*;
use syntax::abi::{Abi, lookup as lookup_abi};

use {LinkerFlavor, PanicStrategy, RelroLevel};
Expand Down Expand Up @@ -147,6 +146,7 @@ supported_targets! {
("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi),
("arm-unknown-linux-gnueabihf", arm_unknown_linux_gnueabihf),
("arm-unknown-linux-musleabi", arm_unknown_linux_musleabi),
Expand All @@ -156,16 +156,17 @@ supported_targets! {
("armv7-unknown-linux-gnueabihf", armv7_unknown_linux_gnueabihf),
("armv7-unknown-linux-musleabihf", armv7_unknown_linux_musleabihf),
("aarch64-unknown-linux-gnu", aarch64_unknown_linux_gnu),

("aarch64-unknown-linux-musl", aarch64_unknown_linux_musl),
("x86_64-unknown-linux-musl", x86_64_unknown_linux_musl),
("i686-unknown-linux-musl", i686_unknown_linux_musl),
("i586-unknown-linux-musl", i586_unknown_linux_musl),
("mips-unknown-linux-musl", mips_unknown_linux_musl),
("mipsel-unknown-linux-musl", mipsel_unknown_linux_musl),

("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),

("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),

("i686-linux-android", i686_linux_android),
("x86_64-linux-android", x86_64_linux_android),
("arm-linux-androideabi", arm_linux_androideabi),
Expand Down Expand Up @@ -809,14 +810,12 @@ impl Target {
pub fn search(target: &str) -> Result<Target, String> {
use std::env;
use std::ffi::OsString;
use std::fs::File;
use std::fs;
use std::path::{Path, PathBuf};
use serialize::json;

fn load_file(path: &Path) -> Result<Target, String> {
let mut f = File::open(path).map_err(|e| e.to_string())?;
let mut contents = Vec::new();
f.read_to_end(&mut contents).map_err(|e| e.to_string())?;
let contents = fs::read(path).map_err(|e| e.to_string())?;
let obj = json::from_reader(&mut &contents[..])
.map_err(|e| e.to_string())?;
Target::from_json(obj)
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_const_eval/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ impl<'a, 'tcx> Pattern<'tcx> {
let mut pcx = PatternContext::new(tcx, param_env_and_substs, tables);
let result = pcx.lower_pattern(pat);
if !pcx.errors.is_empty() {
span_bug!(pat.span, "encountered errors lowering pattern: {:?}", pcx.errors)
let msg = format!("encountered errors lowering pattern: {:?}", pcx.errors);
tcx.sess.delay_span_bug(pat.span, &msg);
}
debug!("Pattern::from_hir({:?}) = {:?}", pat, result);
result
Expand Down
9 changes: 5 additions & 4 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,11 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
let dep_graph = match future_dep_graph {
None => DepGraph::new_disabled(),
Some(future) => {
let prev_graph = future
.open()
.expect("Could not join with background dep_graph thread")
.open(sess);
let prev_graph = time(time_passes, "blocked while dep-graph loading finishes", || {
future.open()
.expect("Could not join with background dep_graph thread")
.open(sess)
});
DepGraph::new(prev_graph)
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_incremental/assert_dep_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc::ich::{ATTR_IF_THIS_CHANGED, ATTR_THEN_THIS_WOULD_NEED};
use graphviz::IntoCow;
use std::env;
use std::fs::File;
use std::fs::{self, File};
use std::io::Write;
use syntax::ast;
use syntax_pos::Span;
Expand Down Expand Up @@ -260,7 +260,7 @@ fn dump_graph(tcx: TyCtxt) {
let dot_path = format!("{}.dot", path);
let mut v = Vec::new();
dot::render(&GraphvizDepGraph(nodes, edges), &mut v).unwrap();
File::create(&dot_path).and_then(|mut f| f.write_all(&v)).unwrap();
fs::write(dot_path, v).unwrap();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/librustc_incremental/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#![deny(warnings)]

#![feature(conservative_impl_trait)]
#![feature(fs_read_write)]
#![feature(i128_type)]
#![feature(inclusive_range_syntax)]
#![feature(specialization)]
Expand Down
Loading

0 comments on commit 51b0b37

Please sign in to comment.