@@ -7,6 +7,7 @@ use rustc_ast::{self as ast, visit};
7
7
use rustc_codegen_ssa:: back:: link:: emit_metadata;
8
8
use rustc_codegen_ssa:: traits:: CodegenBackend ;
9
9
use rustc_data_structures:: parallel;
10
+ use rustc_data_structures:: steal:: Steal ;
10
11
use rustc_data_structures:: sync:: { par_iter, Lrc , OnceCell , ParallelIterator , WorkerLocal } ;
11
12
use rustc_data_structures:: temp_dir:: MaybeTempDir ;
12
13
use rustc_errors:: { ErrorReported , PResult } ;
@@ -270,7 +271,7 @@ fn pre_expansion_lint(
270
271
271
272
fn configure_and_expand_inner < ' a > (
272
273
sess : & ' a Session ,
273
- lint_store : & LintStore ,
274
+ lint_store : & ' a LintStore ,
274
275
mut krate : ast:: Crate ,
275
276
crate_name : & str ,
276
277
resolver_arenas : & ' a ResolverArenas < ' a > ,
@@ -593,7 +594,7 @@ fn escape_dep_env(symbol: Symbol) -> String {
593
594
594
595
fn write_out_deps (
595
596
sess : & Session ,
596
- resolver : & Resolver < ' _ > ,
597
+ boxed_resolver : & Steal < Rc < RefCell < BoxedResolver > > > ,
597
598
outputs : & OutputFilenames ,
598
599
out_filenames : & [ PathBuf ] ,
599
600
) {
@@ -620,18 +621,20 @@ fn write_out_deps(
620
621
}
621
622
622
623
if sess. binary_dep_depinfo ( ) {
623
- for cnum in resolver. cstore ( ) . crates_untracked ( ) {
624
- let source = resolver. cstore ( ) . crate_source_untracked ( cnum) ;
625
- if let Some ( ( path, _) ) = source. dylib {
626
- files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
627
- }
628
- if let Some ( ( path, _) ) = source. rlib {
629
- files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
630
- }
631
- if let Some ( ( path, _) ) = source. rmeta {
632
- files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
624
+ boxed_resolver. borrow ( ) . borrow_mut ( ) . access ( |resolver| {
625
+ for cnum in resolver. cstore ( ) . crates_untracked ( ) {
626
+ let source = resolver. cstore ( ) . crate_source_untracked ( cnum) ;
627
+ if let Some ( ( path, _) ) = source. dylib {
628
+ files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
629
+ }
630
+ if let Some ( ( path, _) ) = source. rlib {
631
+ files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
632
+ }
633
+ if let Some ( ( path, _) ) = source. rmeta {
634
+ files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
635
+ }
633
636
}
634
- }
637
+ } ) ;
635
638
}
636
639
637
640
let mut file = BufWriter :: new ( fs:: File :: create ( & deps_filename) ?) ;
@@ -687,7 +690,7 @@ pub fn prepare_outputs(
687
690
sess : & Session ,
688
691
compiler : & Compiler ,
689
692
krate : & ast:: Crate ,
690
- resolver : & Resolver < ' _ > ,
693
+ boxed_resolver : & Steal < Rc < RefCell < BoxedResolver > > > ,
691
694
crate_name : & str ,
692
695
) -> Result < OutputFilenames > {
693
696
let _timer = sess. timer ( "prepare_outputs" ) ;
@@ -727,7 +730,7 @@ pub fn prepare_outputs(
727
730
}
728
731
}
729
732
730
- write_out_deps ( sess, resolver , & outputs, & output_paths) ;
733
+ write_out_deps ( sess, boxed_resolver , & outputs, & output_paths) ;
731
734
732
735
let only_dep_info = sess. opts . output_types . contains_key ( & OutputType :: DepInfo )
733
736
&& sess. opts . output_types . len ( ) == 1 ;
0 commit comments