Skip to content

Commit 712e755

Browse files
committed
Auto merge of #47350 - kennytm:rollup, r=kennytm
Rollup of 12 pull requests - Successful merges: #47283, #47288, #47289, #47298, #47305, #47307, #47310, #47322, #47324, #47328, #47340, #47344 - Failed merges:
2 parents 73ac5d6 + 5bd7d69 commit 712e755

File tree

39 files changed

+244
-146
lines changed

39 files changed

+244
-146
lines changed

src/Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ci/docker/scripts/musl.sh

Lines changed: 1 addition & 1 deletion
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

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 5 deletions
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

Lines changed: 1 addition & 0 deletions
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;

src/librustc_back/target/mod.rs

Lines changed: 2 additions & 5 deletions
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};
@@ -809,14 +808,12 @@ impl Target {
809808
pub fn search(target: &str) -> Result<Target, String> {
810809
use std::env;
811810
use std::ffi::OsString;
812-
use std::fs::File;
811+
use std::fs;
813812
use std::path::{Path, PathBuf};
814813
use serialize::json;
815814

816815
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())?;
816+
let contents = fs::read(path).map_err(|e| e.to_string())?;
820817
let obj = json::from_reader(&mut &contents[..])
821818
.map_err(|e| e.to_string())?;
822819
Target::from_json(obj)

src/librustc_incremental/assert_dep_graph.rs

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 0 deletions
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)]

src/librustc_incremental/persist/file_format.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
2222
use std::io::{self, Read};
2323
use std::path::Path;
24-
use std::fs::File;
24+
use std::fs;
2525
use std::env;
2626

2727
use rustc::session::config::nightly_options;
@@ -66,11 +66,7 @@ pub fn read_file(report_incremental_info: bool, path: &Path)
6666
return Ok(None);
6767
}
6868

69-
let mut file = File::open(path)?;
70-
let file_size = file.metadata()?.len() as usize;
71-
72-
let mut data = Vec::with_capacity(file_size);
73-
file.read_to_end(&mut data)?;
69+
let data = fs::read(path)?;
7470

7571
let mut file = io::Cursor::new(data);
7672

0 commit comments

Comments
 (0)