Skip to content

Rollup of 24 pull requests #47392

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

Merged
merged 55 commits into from
Jan 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e0855ff
Implement AsRef<Path> for Component
Diggsey Dec 24, 2017
bafbac4
rustfmt libarena/lib.rs
Dec 29, 2017
b2d0d18
fixup
Dec 29, 2017
9991fdf
Fix nested imports not included in the save_analysis output
pietroalbini Dec 30, 2017
45c2c9a
Clean output
ritiek Jan 4, 2018
4054030
Show line numbers
ritiek Jan 6, 2018
b5a3f56
Update musl to 1.1.18
malbarbo Jan 8, 2018
b1c9b6e
Update jobserver to 0.1.9
cuviper Jan 9, 2018
a713c67
Skip linker-output-non-utf8 test on Apple
etaoins Jan 9, 2018
7b420cf
Treat #[path] files as mod.rs files
cramertj Jan 9, 2018
4cc0fe5
Restore the original Window comment
etaoins Jan 9, 2018
b69c320
Fix typo
etaoins Jan 9, 2018
ce4673d
Use copy/clone closures to simplify calendar test
cramertj Jan 10, 2018
d0d5db6
fix typo rwlock.rs
bmusin Jan 10, 2018
fe21c4c
Add -Ztime-passes line for dep-graph loading.
michaelwoerister Jan 10, 2018
44912bf
Pre-allocate in fs::read and fs::read_string
mbrubeck Jan 10, 2018
c78679d
Fix panic strings.
dlrobertson Jan 10, 2018
3f9c057
Use the new fs_read_write functions in rustc internals
mbrubeck Jan 10, 2018
9d9504a
Fix typo.
Jan 10, 2018
2e0ad5a
Glued tokens can themselves be joint.
goffrie Jan 11, 2018
9649c4a
Add tests to fixed issues.
topecongiro Jan 11, 2018
9babb8a
Make libtest build on CloudABI.
EdSchouten Jan 11, 2018
fc825f0
Fix confusing documentation for OsStr
whentze Jan 11, 2018
bac725e
Fix dead links in docs for OsStr
whentze Jan 11, 2018
882cd3c
Add i586-unknown-linux-musl target
malbarbo Jan 4, 2018
e2c1a93
Don't track local_needs_drop separately in qualify_consts (fixes #473…
alexreg Jan 10, 2018
8002876
s/OsStr/&OsStr in docs to align with &str/String comparison
whentze Jan 11, 2018
53c05ff
Enable num tests on wasm
Diggsey Jan 11, 2018
7cad7f6
Fix Duration::subsec_millis and Duration::subsec_micros examples
overvenus Jan 12, 2018
142134d
Ignore CTFE errors while lowering patterns
topecongiro Jan 12, 2018
42410a9
Use delay_span_bug() over debug!()
topecongiro Jan 12, 2018
743b976
Rollup merge of #46985 - Diggsey:path-component-asref, r=alexcrichton
kennytm Jan 12, 2018
30a3516
Rollup merge of #47069 - Kagamihime:master, r=nrc
kennytm Jan 12, 2018
b35cb1e
Rollup merge of #47081 - pietroalbini:fix-nested-tree-dump, r=nrc
kennytm Jan 12, 2018
6ac0888
Rollup merge of #47185 - ritiek:ui-test-failed-output, r=nikomatsakis
kennytm Jan 12, 2018
f30f18f
Rollup merge of #47282 - malbarbo:i586-musl, r=alexcrichton
kennytm Jan 12, 2018
0d199d5
Rollup merge of #47283 - malbarbo:musl-1.1.18, r=alexcrichton
kennytm Jan 12, 2018
1233602
Rollup merge of #47288 - cuviper:jobserver-pipe2, r=alexcrichton
kennytm Jan 12, 2018
8aab0cc
Rollup merge of #47289 - etaoins:skip-linker-output-non-utf8-test-on-…
kennytm Jan 12, 2018
e40a6fb
Rollup merge of #47298 - cramertj:path-as-modrs, r=nikomatsakis
kennytm Jan 12, 2018
f4ff4c0
Rollup merge of #47305 - cramertj:better-calendar-alone, r=eddyb
kennytm Jan 12, 2018
df8f2c6
Rollup merge of #47306 - alexreg:dataflow-analysis, r=eddyb
kennytm Jan 12, 2018
9bedbcc
Rollup merge of #47307 - dlrobertson:fix_panic_strings, r=kennytm
kennytm Jan 12, 2018
426036b
Rollup merge of #47310 - bmusin:patch-1, r=sfackler
kennytm Jan 12, 2018
52770e6
Rollup merge of #47324 - mbrubeck:len, r=sfackler
kennytm Jan 12, 2018
7ffdabd
Rollup merge of #47328 - mbrubeck:fs_read, r=sfackler
kennytm Jan 12, 2018
30dbbb5
Rollup merge of #47331 - michaelwoerister:measure-depgraph-loading, r…
kennytm Jan 12, 2018
cf70a48
Rollup merge of #47340 - alercah:typo-fix, r=GuillaumeGomez
kennytm Jan 12, 2018
b480366
Rollup merge of #47343 - goffrie:master, r=jseyfried
kennytm Jan 12, 2018
f589482
Rollup merge of #47344 - topecongiro:fixed-ices, r=alexcrichton
kennytm Jan 12, 2018
a63121c
Rollup merge of #47352 - EdSchouten:cloudabi-libtest, r=kennytm
kennytm Jan 12, 2018
db36d18
Rollup merge of #47357 - whentze:osstr-doc-fix, r=GuillaumeGomez
kennytm Jan 12, 2018
722838f
Rollup merge of #47365 - Diggsey:issue-42630, r=alexcrichton
kennytm Jan 12, 2018
21ac84e
Rollup merge of #47375 - overvenus:duration-examples, r=dtolnay
kennytm Jan 12, 2018
c12eabf
Rollup merge of #47382 - topecongiro:issue-43105, r=eddyb
kennytm Jan 12, 2018
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
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