@@ -491,16 +491,16 @@ impl BuildQueue {
491
491
} ) ;
492
492
493
493
// 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.
496
495
let stderr_json_msg = convert_message_to_json_strings ( Arc :: try_unwrap ( err_buf)
497
496
. unwrap ( )
498
497
. into_inner ( )
499
498
. unwrap ( ) ) ;
500
499
500
+ let analysis = analysis. lock ( ) . unwrap ( ) . clone ( ) ;
501
501
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) ,
504
504
} ;
505
505
506
506
// Our compiler controller. We mostly delegate to the default rustc
@@ -566,7 +566,10 @@ impl BuildQueue {
566
566
state. crate_name . unwrap ( ) ,
567
567
CallbackHandler { callback : & mut |a| {
568
568
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) ;
570
573
} } ) ;
571
574
} ) ;
572
575
result. after_analysis . run_callback_on_error = true ;
0 commit comments