Replace tempdir by tempfile in librustdoc
This commit is contained in:
@@ -2427,7 +2427,7 @@ version = "0.0.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"minifier 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"minifier 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"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]]
|
[[package]]
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ path = "lib.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
pulldown-cmark = { version = "0.1.2", default-features = false }
|
pulldown-cmark = { version = "0.1.2", default-features = false }
|
||||||
tempdir = "0.3"
|
|
||||||
minifier = "0.0.11"
|
minifier = "0.0.11"
|
||||||
|
tempfile = "3"
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ extern crate test as testing;
|
|||||||
#[macro_use] extern crate log;
|
#[macro_use] extern crate log;
|
||||||
extern crate rustc_errors as errors;
|
extern crate rustc_errors as errors;
|
||||||
extern crate pulldown_cmark;
|
extern crate pulldown_cmark;
|
||||||
extern crate tempdir;
|
extern crate tempfile;
|
||||||
extern crate minifier;
|
extern crate minifier;
|
||||||
|
|
||||||
extern crate serialize as rustc_serialize; // used by deriving
|
extern crate serialize as rustc_serialize; // used by deriving
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ use rustc::session::{self, CompileIncomplete, config};
|
|||||||
use rustc::session::config::{OutputType, OutputTypes, Externs, CodegenOptions};
|
use rustc::session::config::{OutputType, OutputTypes, Externs, CodegenOptions};
|
||||||
use rustc::session::search_paths::{SearchPaths, PathKind};
|
use rustc::session::search_paths::{SearchPaths, PathKind};
|
||||||
use rustc_metadata::dynamic_lib::DynamicLibrary;
|
use rustc_metadata::dynamic_lib::DynamicLibrary;
|
||||||
use tempdir::TempDir;
|
use tempfile::Builder as TempFileBuilder;
|
||||||
use rustc_driver::{self, driver, target_features, Compilation};
|
use rustc_driver::{self, driver, target_features, Compilation};
|
||||||
use rustc_driver::driver::phase_2_configure_and_expand;
|
use rustc_driver::driver::phase_2_configure_and_expand;
|
||||||
use rustc_metadata::cstore::CStore;
|
use rustc_metadata::cstore::CStore;
|
||||||
@@ -277,7 +277,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
|
|||||||
let cstore = CStore::new(codegen_backend.metadata_loader());
|
let cstore = CStore::new(codegen_backend.metadata_loader());
|
||||||
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
|
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
|
||||||
|
|
||||||
let outdir = Mutex::new(TempDir::new("rustdoctest").ok().expect("rustdoc needs a tempdir"));
|
let outdir = Mutex::new(TempFileBuilder::new().prefix("rustdoctest").tempdir().expect("rustdoc needs a tempdir"));
|
||||||
let libdir = sess.target_filesearch(PathKind::All).get_lib_path();
|
let libdir = sess.target_filesearch(PathKind::All).get_lib_path();
|
||||||
let mut control = driver::CompileController::basic();
|
let mut control = driver::CompileController::basic();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user