@@ -30,7 +30,7 @@ use rustc_plugin_impl as plugin;
3030use rustc_query_impl:: { OnDiskCache , Queries as TcxQueries } ;
3131use rustc_resolve:: { Resolver , ResolverArenas } ;
3232use rustc_session:: config:: { CrateType , Input , OutputFilenames , OutputType } ;
33- use rustc_session:: cstore:: { MetadataLoader , MetadataLoaderDyn , Untracked } ;
33+ use rustc_session:: cstore:: { CrateStoreDyn , MetadataLoader , MetadataLoaderDyn , Untracked } ;
3434use rustc_session:: output:: filename_for_input;
3535use rustc_session:: search_paths:: PathKind ;
3636use rustc_session:: { Limit , Session } ;
@@ -548,7 +548,7 @@ fn escape_dep_env(symbol: Symbol) -> String {
548548
549549fn write_out_deps (
550550 sess : & Session ,
551- boxed_resolver : & RefCell < BoxedResolver > ,
551+ cstore : & CrateStoreDyn ,
552552 outputs : & OutputFilenames ,
553553 out_filenames : & [ PathBuf ] ,
554554) {
@@ -600,20 +600,19 @@ fn write_out_deps(
600600 }
601601 }
602602
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 ( ) ) ) ;
615608 }
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+ }
617616 }
618617
619618 let mut file = BufWriter :: new ( fs:: File :: create ( & deps_filename) ?) ;
@@ -664,7 +663,7 @@ fn write_out_deps(
664663pub fn prepare_outputs (
665664 sess : & Session ,
666665 krate : & ast:: Crate ,
667- boxed_resolver : & RefCell < BoxedResolver > ,
666+ cstore : & CrateStoreDyn ,
668667 crate_name : Symbol ,
669668) -> Result < OutputFilenames > {
670669 let _timer = sess. timer ( "prepare_outputs" ) ;
@@ -697,7 +696,7 @@ pub fn prepare_outputs(
697696 }
698697 }
699698
700- write_out_deps ( sess, boxed_resolver , & outputs, & output_paths) ;
699+ write_out_deps ( sess, cstore , & outputs, & output_paths) ;
701700
702701 let only_dep_info = sess. opts . output_types . contains_key ( & OutputType :: DepInfo )
703702 && sess. opts . output_types . len ( ) == 1 ;
0 commit comments