Skip to content

Commit abd9149

Browse files
committed
centralize diagnostic server stuff
1 parent b9f3c16 commit abd9149

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/cargo/core/compiler/compilation.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ impl<'cfg> Compilation<'cfg> {
8080
if bcx.config.extra_verbose() {
8181
rustc.display_env_vars();
8282
}
83-
let srv = bcx.build_config.rustfix_diagnostic_server.borrow();
84-
if let Some(server) = &*srv {
85-
server.configure(&mut rustc);
86-
}
83+
8784
Ok(Compilation {
8885
// TODO: deprecated; remove.
8986
native_dirs: BTreeSet::new(),

src/cargo/ops/fix.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ pub fn fix(ws: &Workspace<'_>, opts: &mut FixOptions<'_>) -> CargoResult<()> {
119119
.build_config
120120
.rustfix_diagnostic_server
121121
.borrow_mut() = Some(RustfixDiagnosticServer::new()?);
122+
123+
if let Some(server) = opts
124+
.compile_opts
125+
.build_config
126+
.rustfix_diagnostic_server
127+
.borrow()
128+
.as_ref()
129+
{
130+
server.configure(&mut wrapper);
131+
}
132+
122133
opts.compile_opts.build_config.rustc_wrapper = Some(wrapper);
123134

124135
ops::compile(ws, &opts.compile_opts)?;

0 commit comments

Comments
 (0)