Skip to content

Commit 51b0b37

Browse files
committed
Auto merge of #47392 - kennytm:rollup, r=kennytm
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
2 parents 0b90e4e + c12eabf commit 51b0b37

File tree

57 files changed

+490
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+490
-225
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ matrix:
126126
if: branch = auto
127127
- env: IMAGE=dist-armv7-linux DEPLOY=1
128128
if: branch = auto
129-
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
129+
- env: IMAGE=dist-i586-gnu-i586-i686-musl DEPLOY=1
130130
if: branch = auto
131131
- env: IMAGE=dist-i686-freebsd DEPLOY=1
132132
if: branch = auto

src/Cargo.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/configure.py

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ def v(*args):
108108
"MUSL root installation directory (deprecated)")
109109
v("musl-root-x86_64", "target.x86_64-unknown-linux-musl.musl-root",
110110
"x86_64-unknown-linux-musl install directory")
111+
v("musl-root-i586", "target.i586-unknown-linux-musl.musl-root",
112+
"i586-unknown-linux-musl install directory")
111113
v("musl-root-i686", "target.i686-unknown-linux-musl.musl-root",
112114
"i686-unknown-linux-musl install directory")
113115
v("musl-root-arm", "target.arm-unknown-linux-musleabi.musl-root",

src/bootstrap/native.rs

+2
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ impl Step for Openssl {
429429
"arm-unknown-linux-gnueabihf" => "linux-armv4",
430430
"armv7-linux-androideabi" => "android-armv7",
431431
"armv7-unknown-linux-gnueabihf" => "linux-armv4",
432+
"i586-unknown-linux-gnu" => "linux-elf",
433+
"i586-unknown-linux-musl" => "linux-elf",
432434
"i686-apple-darwin" => "darwin-i386-cc",
433435
"i686-linux-android" => "android-x86",
434436
"i686-unknown-freebsd" => "BSD-x86-elf",

src/ci/docker/dist-i586-gnu-i686-musl/Dockerfile renamed to src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile

+12-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ COPY scripts/musl.sh /build/
2121
RUN CC=gcc CFLAGS="-m32 -fPIC -Wa,-mrelax-relocations=no" \
2222
CXX=g++ CXXFLAGS="-m32 -Wa,-mrelax-relocations=no" \
2323
bash musl.sh i686 --target=i686 && \
24+
CC=gcc CFLAGS="-march=pentium -m32 -fPIC -Wa,-mrelax-relocations=no" \
25+
CXX=g++ CXXFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \
26+
bash musl.sh i586 --target=i586 && \
2427
rm -rf /build
2528

2629
COPY scripts/sccache.sh /scripts/
2730
RUN sh /scripts/sccache.sh
2831

2932
ENV RUST_CONFIGURE_ARGS \
3033
--target=i686-unknown-linux-musl,i586-unknown-linux-gnu \
34+
--musl-root-i586=/musl-i586 \
3135
--musl-root-i686=/musl-i686 \
3236
--enable-extended
3337

@@ -38,12 +42,13 @@ ENV RUST_CONFIGURE_ARGS \
3842
# See: https://github.com/rust-lang/rust/issues/34978
3943
ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no
4044
ENV CFLAGS_i586_unknown_linux_gnu=-Wa,-mrelax-relocations=no
45+
# FIXME remove -Wl,-melf_i386 after cc is updated to include
46+
# https://github.com/alexcrichton/cc-rs/pull/281
47+
ENV CFLAGS_i586_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wl,-melf_i386"
48+
49+
ENV TARGETS=i586-unknown-linux-gnu
50+
ENV TARGETS=$TARGETS,i686-unknown-linux-musl
4151

4252
ENV SCRIPT \
43-
python2.7 ../x.py test \
44-
--target i686-unknown-linux-musl \
45-
--target i586-unknown-linux-gnu \
46-
&& \
47-
python2.7 ../x.py dist \
48-
--target i686-unknown-linux-musl \
49-
--target i586-unknown-linux-gnu
53+
python2.7 ../x.py test --target $TARGETS && \
54+
python2.7 ../x.py dist --target $TARGETS,i586-unknown-linux-musl

src/ci/docker/scripts/musl.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exit 1
3030
TAG=$1
3131
shift
3232

33-
MUSL=musl-1.1.17
33+
MUSL=musl-1.1.18
3434

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

4040
cd $MUSL
4141
./configure --disable-shared --prefix=/musl-$TAG $@
42-
if [ "$TAG" = "i686" ]; then
42+
if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
4343
hide_output make -j$(nproc) AR=ar RANLIB=ranlib
4444
else
4545
hide_output make -j$(nproc)

src/libarena/lib.rs

+24-11
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ struct TypedArenaChunk<T> {
6969
impl<T> TypedArenaChunk<T> {
7070
#[inline]
7171
unsafe fn new(capacity: usize) -> TypedArenaChunk<T> {
72-
TypedArenaChunk { storage: RawVec::with_capacity(capacity) }
72+
TypedArenaChunk {
73+
storage: RawVec::with_capacity(capacity),
74+
}
7375
}
7476

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

133135
unsafe {
134136
if mem::size_of::<T>() == 0 {
135-
self.ptr.set(intrinsics::arith_offset(self.ptr.get() as *mut u8, 1) as *mut T);
137+
self.ptr
138+
.set(intrinsics::arith_offset(self.ptr.get() as *mut u8, 1)
139+
as *mut T);
136140
let ptr = mem::align_of::<T>() as *mut T;
137141
// Don't drop the object. This `write` is equivalent to `forget`.
138142
ptr::write(ptr, object);
@@ -157,7 +161,9 @@ impl<T> TypedArena<T> {
157161
/// - Zero-length slices
158162
#[inline]
159163
pub fn alloc_slice(&self, slice: &[T]) -> &mut [T]
160-
where T: Copy {
164+
where
165+
T: Copy,
166+
{
161167
assert!(mem::size_of::<T>() != 0);
162168
assert!(slice.len() != 0);
163169

@@ -321,7 +327,10 @@ impl DroplessArena {
321327
let (chunk, mut new_capacity);
322328
if let Some(last_chunk) = chunks.last_mut() {
323329
let used_bytes = self.ptr.get() as usize - last_chunk.start() as usize;
324-
if last_chunk.storage.reserve_in_place(used_bytes, needed_bytes) {
330+
if last_chunk
331+
.storage
332+
.reserve_in_place(used_bytes, needed_bytes)
333+
{
325334
self.end.set(last_chunk.end());
326335
return;
327336
} else {
@@ -357,9 +366,9 @@ impl DroplessArena {
357366

358367
let ptr = self.ptr.get();
359368
// Set the pointer past ourselves
360-
self.ptr.set(intrinsics::arith_offset(
361-
self.ptr.get(), mem::size_of::<T>() as isize
362-
) as *mut u8);
369+
self.ptr.set(
370+
intrinsics::arith_offset(self.ptr.get(), mem::size_of::<T>() as isize) as *mut u8,
371+
);
363372
// Write into uninitialized memory.
364373
ptr::write(ptr as *mut T, object);
365374
&mut *(ptr as *mut T)
@@ -375,7 +384,9 @@ impl DroplessArena {
375384
/// - Zero-length slices
376385
#[inline]
377386
pub fn alloc_slice<T>(&self, slice: &[T]) -> &mut [T]
378-
where T: Copy {
387+
where
388+
T: Copy,
389+
{
379390
assert!(!mem::needs_drop::<T>());
380391
assert!(mem::size_of::<T>() != 0);
381392
assert!(slice.len() != 0);
@@ -391,7 +402,8 @@ impl DroplessArena {
391402
unsafe {
392403
let arena_slice = slice::from_raw_parts_mut(self.ptr.get() as *mut T, slice.len());
393404
self.ptr.set(intrinsics::arith_offset(
394-
self.ptr.get(), (slice.len() * mem::size_of::<T>()) as isize
405+
self.ptr.get(),
406+
(slice.len() * mem::size_of::<T>()) as isize,
395407
) as *mut u8);
396408
arena_slice.copy_from_slice(slice);
397409
arena_slice
@@ -456,8 +468,9 @@ mod tests {
456468

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

459-
let result =
460-
arena.alloc_outer(|| Outer { inner: arena.alloc_inner(|| Inner { value: 10 }) });
471+
let result = arena.alloc_outer(|| Outer {
472+
inner: arena.alloc_inner(|| Inner { value: 10 }),
473+
});
461474

462475
assert_eq!(result.inner.value, 10);
463476
}

src/libcore/tests/num/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ test_impl_from! { test_u16f64, u16, f64 }
197197
test_impl_from! { test_u32f64, u32, f64 }
198198

199199
// Float -> Float
200-
#[cfg_attr(all(target_arch = "wasm32", target_os = "emscripten"), ignore)] // issue 42630
201200
#[test]
202201
fn test_f32f64() {
203202
use core::f32;

src/librustc/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#![feature(drain_filter)]
4949
#![feature(dyn_trait)]
5050
#![feature(from_ref)]
51+
#![feature(fs_read_write)]
5152
#![feature(i128)]
5253
#![feature(i128_type)]
5354
#![feature(inclusive_range)]

src/librustc/lint/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ pub fn check_ast_crate(sess: &Session, krate: &ast::Crate) {
10461046
// calculated the lint levels for all AST nodes.
10471047
for (_id, lints) in cx.buffered.map {
10481048
for early_lint in lints {
1049-
span_bug!(early_lint.span, "failed to process bufferd lint here");
1049+
span_bug!(early_lint.span, "failed to process buffered lint here");
10501050
}
10511051
}
10521052
}

src/librustc/util/common.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,10 @@ pub fn record_time<T, F>(accu: &Cell<Duration>, f: F) -> T where
218218
// Memory reporting
219219
#[cfg(unix)]
220220
fn get_resident() -> Option<usize> {
221-
use std::fs::File;
222-
use std::io::Read;
221+
use std::fs;
223222

224223
let field = 1;
225-
let mut f = File::open("/proc/self/statm").ok()?;
226-
let mut contents = String::new();
227-
f.read_to_string(&mut contents).ok()?;
224+
let contents = fs::read_string("/proc/self/statm").ok()?;
228225
let s = contents.split_whitespace().nth(field)?;
229226
let npages = s.parse::<usize>().ok()?;
230227
Some(npages * 4096)

src/librustc_back/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#![feature(box_syntax)]
3030
#![feature(const_fn)]
31+
#![feature(fs_read_write)]
3132

3233
extern crate syntax;
3334
extern crate rand;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use target::TargetResult;
12+
13+
pub fn target() -> TargetResult {
14+
let mut base = super::i686_unknown_linux_musl::target()?;
15+
base.options.cpu = "pentium".to_string();
16+
base.llvm_target = "i586-unknown-linux-musl".to_string();
17+
Ok(base)
18+
}

src/librustc_back/target/mod.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
use serialize::json::{Json, ToJson};
4848
use std::collections::BTreeMap;
4949
use std::default::Default;
50-
use std::io::prelude::*;
5150
use syntax::abi::{Abi, lookup as lookup_abi};
5251

5352
use {LinkerFlavor, PanicStrategy, RelroLevel};
@@ -147,6 +146,7 @@ supported_targets! {
147146
("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
148147
("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
149148
("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
149+
("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
150150
("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi),
151151
("arm-unknown-linux-gnueabihf", arm_unknown_linux_gnueabihf),
152152
("arm-unknown-linux-musleabi", arm_unknown_linux_musleabi),
@@ -156,16 +156,17 @@ supported_targets! {
156156
("armv7-unknown-linux-gnueabihf", armv7_unknown_linux_gnueabihf),
157157
("armv7-unknown-linux-musleabihf", armv7_unknown_linux_musleabihf),
158158
("aarch64-unknown-linux-gnu", aarch64_unknown_linux_gnu),
159+
159160
("aarch64-unknown-linux-musl", aarch64_unknown_linux_musl),
160161
("x86_64-unknown-linux-musl", x86_64_unknown_linux_musl),
161162
("i686-unknown-linux-musl", i686_unknown_linux_musl),
163+
("i586-unknown-linux-musl", i586_unknown_linux_musl),
162164
("mips-unknown-linux-musl", mips_unknown_linux_musl),
163165
("mipsel-unknown-linux-musl", mipsel_unknown_linux_musl),
166+
164167
("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
165168
("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),
166169

167-
("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
168-
169170
("i686-linux-android", i686_linux_android),
170171
("x86_64-linux-android", x86_64_linux_android),
171172
("arm-linux-androideabi", arm_linux_androideabi),
@@ -809,14 +810,12 @@ impl Target {
809810
pub fn search(target: &str) -> Result<Target, String> {
810811
use std::env;
811812
use std::ffi::OsString;
812-
use std::fs::File;
813+
use std::fs;
813814
use std::path::{Path, PathBuf};
814815
use serialize::json;
815816

816817
fn load_file(path: &Path) -> Result<Target, String> {
817-
let mut f = File::open(path).map_err(|e| e.to_string())?;
818-
let mut contents = Vec::new();
819-
f.read_to_end(&mut contents).map_err(|e| e.to_string())?;
818+
let contents = fs::read(path).map_err(|e| e.to_string())?;
820819
let obj = json::from_reader(&mut &contents[..])
821820
.map_err(|e| e.to_string())?;
822821
Target::from_json(obj)

src/librustc_const_eval/pattern.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ impl<'a, 'tcx> Pattern<'tcx> {
280280
let mut pcx = PatternContext::new(tcx, param_env_and_substs, tables);
281281
let result = pcx.lower_pattern(pat);
282282
if !pcx.errors.is_empty() {
283-
span_bug!(pat.span, "encountered errors lowering pattern: {:?}", pcx.errors)
283+
let msg = format!("encountered errors lowering pattern: {:?}", pcx.errors);
284+
tcx.sess.delay_span_bug(pat.span, &msg);
284285
}
285286
debug!("Pattern::from_hir({:?}) = {:?}", pat, result);
286287
result

src/librustc_driver/driver.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -889,10 +889,11 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
889889
let dep_graph = match future_dep_graph {
890890
None => DepGraph::new_disabled(),
891891
Some(future) => {
892-
let prev_graph = future
893-
.open()
894-
.expect("Could not join with background dep_graph thread")
895-
.open(sess);
892+
let prev_graph = time(time_passes, "blocked while dep-graph loading finishes", || {
893+
future.open()
894+
.expect("Could not join with background dep_graph thread")
895+
.open(sess)
896+
});
896897
DepGraph::new(prev_graph)
897898
}
898899
};

src/librustc_incremental/assert_dep_graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
5555
use rustc::ich::{ATTR_IF_THIS_CHANGED, ATTR_THEN_THIS_WOULD_NEED};
5656
use graphviz::IntoCow;
5757
use std::env;
58-
use std::fs::File;
58+
use std::fs::{self, File};
5959
use std::io::Write;
6060
use syntax::ast;
6161
use syntax_pos::Span;
@@ -260,7 +260,7 @@ fn dump_graph(tcx: TyCtxt) {
260260
let dot_path = format!("{}.dot", path);
261261
let mut v = Vec::new();
262262
dot::render(&GraphvizDepGraph(nodes, edges), &mut v).unwrap();
263-
File::create(&dot_path).and_then(|mut f| f.write_all(&v)).unwrap();
263+
fs::write(dot_path, v).unwrap();
264264
}
265265
}
266266

src/librustc_incremental/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#![deny(warnings)]
1717

1818
#![feature(conservative_impl_trait)]
19+
#![feature(fs_read_write)]
1920
#![feature(i128_type)]
2021
#![feature(inclusive_range_syntax)]
2122
#![feature(specialization)]

0 commit comments

Comments
 (0)