mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
Replace tempdir by tempfile in librustc_trans
This commit is contained in:
parent
ae9a27185e
commit
677eeaaa61
@ -2103,7 +2103,7 @@ dependencies = [
|
||||
"serialize 0.0.0",
|
||||
"syntax 0.0.0",
|
||||
"syntax_pos 0.0.0",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -32,7 +32,7 @@ rustc_mir = { path = "../librustc_mir" }
|
||||
serialize = { path = "../libserialize" }
|
||||
syntax = { path = "../libsyntax" }
|
||||
syntax_pos = { path = "../libsyntax_pos" }
|
||||
tempdir = "0.3"
|
||||
tempfile = "3.0"
|
||||
|
||||
# not actually used but needed to make sure we enable the same feature set as
|
||||
# winapi used in librustc
|
||||
|
@ -28,7 +28,7 @@ use {CodegenResults, CrateInfo};
|
||||
use rustc::util::common::time;
|
||||
use rustc::util::fs::fix_windows_verbatim_for_gcc;
|
||||
use rustc::hir::def_id::CrateNum;
|
||||
use tempdir::TempDir;
|
||||
use tempfile::{Builder as TempFileBuilder, TempDir};
|
||||
use rustc_target::spec::{PanicStrategy, RelroLevel, LinkerFlavor, TargetTriple};
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use context::get_reloc_model;
|
||||
@ -321,7 +321,7 @@ fn link_binary_output(sess: &Session,
|
||||
// final destination, with a `fs::rename` call. In order for the rename to
|
||||
// always succeed, the temporary file needs to be on the same filesystem,
|
||||
// which is why we create it inside the output directory specifically.
|
||||
let metadata_tmpdir = match TempDir::new_in(out_filename.parent().unwrap(), "rmeta") {
|
||||
let metadata_tmpdir = match TempFileBuilder::new().prefix("rmeta").tempdir_in(out_filename.parent().unwrap()) {
|
||||
Ok(tmpdir) => tmpdir,
|
||||
Err(err) => sess.fatal(&format!("couldn't create a temp dir: {}", err)),
|
||||
};
|
||||
@ -332,7 +332,7 @@ fn link_binary_output(sess: &Session,
|
||||
out_filenames.push(out_filename);
|
||||
}
|
||||
|
||||
let tmpdir = match TempDir::new("rustc") {
|
||||
let tmpdir = match TempFileBuilder::new().prefix("rustc").tempdir() {
|
||||
Ok(tmpdir) => tmpdir,
|
||||
Err(err) => sess.fatal(&format!("couldn't create a temp dir: {}", err)),
|
||||
};
|
||||
|
@ -56,7 +56,7 @@ extern crate syntax_pos;
|
||||
extern crate rustc_errors as errors;
|
||||
extern crate serialize;
|
||||
extern crate cc; // Used to locate MSVC
|
||||
extern crate tempdir;
|
||||
extern crate tempfile;
|
||||
|
||||
use back::bytecode::RLIB_BYTECODE_EXTENSION;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user