Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 92f5889

Browse files
committed
Very minor refactorings
Left over from some bug hunting
1 parent 5551c4e commit 92f5889

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/build.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,16 @@ impl BuildQueue {
491491
});
492492

493493
// FIXME(#25) given that we are running the compiler directly, there is no need
494-
// to serialise either the error messages or save-analysis - we should pass
495-
// them both in memory, without using save-analysis.
494+
// to serialise the error messages - we should pass them in memory.
496495
let stderr_json_msg = convert_message_to_json_strings(Arc::try_unwrap(err_buf)
497496
.unwrap()
498497
.into_inner()
499498
.unwrap());
500499

500+
let analysis = analysis.lock().unwrap().clone();
501501
return match exit_code {
502-
Ok(0) => BuildResult::Success(stderr_json_msg, analysis.lock().unwrap().clone()),
503-
_ => BuildResult::Failure(stderr_json_msg, analysis.lock().unwrap().clone()),
502+
Ok(0) => BuildResult::Success(stderr_json_msg, analysis),
503+
_ => BuildResult::Failure(stderr_json_msg, analysis),
504504
};
505505

506506
// Our compiler controller. We mostly delegate to the default rustc
@@ -566,7 +566,10 @@ impl BuildQueue {
566566
state.crate_name.unwrap(),
567567
CallbackHandler { callback: &mut |a| {
568568
let mut analysis = analysis.lock().unwrap();
569-
*analysis = Some(unsafe { ::std::mem::transmute(a.clone()) } );
569+
let a = unsafe {
570+
::std::mem::transmute(a.clone())
571+
};
572+
*analysis = Some(a);
570573
} });
571574
});
572575
result.after_analysis.run_callback_on_error = true;

0 commit comments

Comments
 (0)