centralize diagnostic server stuff

This commit is contained in:
Jane Lusby 2019-07-16 10:52:40 -07:00
parent b9f3c16407
commit abd91493e0
2 changed files with 12 additions and 4 deletions

View File

@ -80,10 +80,7 @@ impl<'cfg> Compilation<'cfg> {
if bcx.config.extra_verbose() {
rustc.display_env_vars();
}
let srv = bcx.build_config.rustfix_diagnostic_server.borrow();
if let Some(server) = &*srv {
server.configure(&mut rustc);
}
Ok(Compilation {
// TODO: deprecated; remove.
native_dirs: BTreeSet::new(),

View File

@ -119,6 +119,17 @@ pub fn fix(ws: &Workspace<'_>, opts: &mut FixOptions<'_>) -> CargoResult<()> {
.build_config
.rustfix_diagnostic_server
.borrow_mut() = Some(RustfixDiagnosticServer::new()?);
if let Some(server) = opts
.compile_opts
.build_config
.rustfix_diagnostic_server
.borrow()
.as_ref()
{
server.configure(&mut wrapper);
}
opts.compile_opts.build_config.rustc_wrapper = Some(wrapper);
ops::compile(ws, &opts.compile_opts)?;