Move basic_options to impl of Default

This commit is contained in:
Mark Rousskov 2018-07-26 12:36:11 -06:00
parent 3cc4450a8a
commit 5fcef251d3
5 changed files with 70 additions and 68 deletions

View file

@ -43,7 +43,7 @@ use clean;
use clean::Clean;
use html::render::RenderInfo;
pub use rustc::session::config::{Input, CodegenOptions};
pub use rustc::session::config::{Input, Options, CodegenOptions};
pub use rustc::session::search_paths::SearchPaths;
pub type ExternalPaths = FxHashMap<DefId, (Vec<String>, clean::TypeKind)>;
@ -127,7 +127,7 @@ pub fn new_handler(error_format: ErrorOutputType, codemap: Option<Lrc<codemap::C
{
// rustdoc doesn't override (or allow to override) anything from this that is relevant here, so
// stick to the defaults
let sessopts = config::basic_options();
let sessopts = Options::default();
let emitter: Box<dyn Emitter + sync::Send> = match error_format {
ErrorOutputType::HumanReadable(color_config) => Box::new(
EmitterWriter::stderr(
@ -243,7 +243,7 @@ pub fn run_core(search_paths: SearchPaths,
error_format,
edition,
describe_lints,
..config::basic_options()
..Options::default()
};
driver::spawn_thread_pool(sessopts, move |sessopts| {
let codemap = Lrc::new(codemap::CodeMap::new(sessopts.file_path_mapping()));

View file

@ -83,7 +83,7 @@ pub fn run(input_path: &Path,
..config::basic_debugging_options()
},
edition,
..config::basic_options().clone()
..config::Options::default()
};
driver::spawn_thread_pool(sessopts, |sessopts| {
let codemap = Lrc::new(CodeMap::new(sessopts.file_path_mapping()));
@ -230,7 +230,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
..config::basic_debugging_options()
},
edition,
..config::basic_options().clone()
..config::Options::default()
};
// Shuffle around a few input and output handles here. We're going to pass