@@ -30,7 +30,7 @@ use rustc_plugin_impl as plugin;
30
30
use rustc_query_impl:: { OnDiskCache , Queries as TcxQueries } ;
31
31
use rustc_resolve:: { Resolver , ResolverArenas } ;
32
32
use rustc_session:: config:: { CrateType , Input , OutputFilenames , OutputType } ;
33
- use rustc_session:: cstore:: { MetadataLoader , MetadataLoaderDyn , Untracked } ;
33
+ use rustc_session:: cstore:: { CrateStoreDyn , MetadataLoader , MetadataLoaderDyn , Untracked } ;
34
34
use rustc_session:: output:: filename_for_input;
35
35
use rustc_session:: search_paths:: PathKind ;
36
36
use rustc_session:: { Limit , Session } ;
@@ -548,7 +548,7 @@ fn escape_dep_env(symbol: Symbol) -> String {
548
548
549
549
fn write_out_deps (
550
550
sess : & Session ,
551
- boxed_resolver : & RefCell < BoxedResolver > ,
551
+ cstore : & CrateStoreDyn ,
552
552
outputs : & OutputFilenames ,
553
553
out_filenames : & [ PathBuf ] ,
554
554
) {
@@ -600,20 +600,19 @@ fn write_out_deps(
600
600
}
601
601
}
602
602
603
- boxed_resolver. borrow_mut ( ) . access ( |resolver| {
604
- for cnum in resolver. cstore ( ) . crates_untracked ( ) {
605
- let source = resolver. cstore ( ) . crate_source_untracked ( cnum) ;
606
- if let Some ( ( path, _) ) = & source. dylib {
607
- files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
608
- }
609
- if let Some ( ( path, _) ) = & source. rlib {
610
- files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
611
- }
612
- if let Some ( ( path, _) ) = & source. rmeta {
613
- files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
614
- }
603
+ let cstore = cstore. as_any ( ) . downcast_ref :: < CStore > ( ) . unwrap ( ) ;
604
+ for cnum in cstore. crates_untracked ( ) {
605
+ let source = cstore. crate_source_untracked ( cnum) ;
606
+ if let Some ( ( path, _) ) = & source. dylib {
607
+ files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
615
608
}
616
- } ) ;
609
+ if let Some ( ( path, _) ) = & source. rlib {
610
+ files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
611
+ }
612
+ if let Some ( ( path, _) ) = & source. rmeta {
613
+ files. push ( escape_dep_filename ( & path. display ( ) . to_string ( ) ) ) ;
614
+ }
615
+ }
617
616
}
618
617
619
618
let mut file = BufWriter :: new ( fs:: File :: create ( & deps_filename) ?) ;
@@ -664,7 +663,7 @@ fn write_out_deps(
664
663
pub fn prepare_outputs (
665
664
sess : & Session ,
666
665
krate : & ast:: Crate ,
667
- boxed_resolver : & RefCell < BoxedResolver > ,
666
+ cstore : & CrateStoreDyn ,
668
667
crate_name : Symbol ,
669
668
) -> Result < OutputFilenames > {
670
669
let _timer = sess. timer ( "prepare_outputs" ) ;
@@ -697,7 +696,7 @@ pub fn prepare_outputs(
697
696
}
698
697
}
699
698
700
- write_out_deps ( sess, boxed_resolver , & outputs, & output_paths) ;
699
+ write_out_deps ( sess, cstore , & outputs, & output_paths) ;
701
700
702
701
let only_dep_info = sess. opts . output_types . contains_key ( & OutputType :: DepInfo )
703
702
&& sess. opts . output_types . len ( ) == 1 ;
0 commit comments