@@ -93,7 +93,7 @@ fn load_dep_graph_if_exists<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
9393}
9494
9595fn load_data ( sess : & Session , path : & Path ) -> Option < Vec < u8 > > {
96- match file_format:: read_file ( path) {
96+ match file_format:: read_file ( sess , path) {
9797 Ok ( Some ( data) ) => return Some ( data) ,
9898 Ok ( None ) => {
9999 // The file either didn't exist or was produced by an incompatible
@@ -132,6 +132,10 @@ pub fn decode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
132132 let prev_commandline_args_hash = u64:: decode ( & mut dep_graph_decoder) ?;
133133
134134 if prev_commandline_args_hash != tcx. sess . opts . dep_tracking_hash ( ) {
135+ if tcx. sess . opts . debugging_opts . incremental_info {
136+ println ! ( "incremental: completely ignoring cache because of \
137+ differing commandline arguments") ;
138+ }
135139 // We can't reuse the cache, purge it.
136140 debug ! ( "decode_dep_graph: differing commandline arg hashes" ) ;
137141 for swp in work_products {
@@ -192,7 +196,8 @@ pub fn decode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
192196 if tcx. sess . opts . debugging_opts . incremental_info {
193197 // It'd be nice to pretty-print these paths better than just
194198 // using the `Debug` impls, but wev.
195- println ! ( "module {:?} is dirty because {:?} changed or was removed" ,
199+ println ! ( "incremental: module {:?} is dirty because {:?} \
200+ changed or was removed",
196201 target_node,
197202 raw_source_node. map_def( |& index| {
198203 Some ( directory. def_path_string( tcx, index) )
@@ -277,14 +282,19 @@ fn reconcile_work_products<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
277282 debug ! ( "reconcile_work_products: dep-node for {:?} is dirty" , swp) ;
278283 delete_dirty_work_product ( tcx, swp) ;
279284 } else {
280- let all_files_exist =
281- swp. work_product
282- . saved_files
283- . iter ( )
284- . all ( |& ( _, ref file_name) | {
285- let path = in_incr_comp_dir_sess ( tcx. sess , & file_name) ;
286- path. exists ( )
287- } ) ;
285+ let mut all_files_exist = true ;
286+ for & ( _, ref file_name) in swp. work_product . saved_files . iter ( ) {
287+ let path = in_incr_comp_dir_sess ( tcx. sess , file_name) ;
288+ if !path. exists ( ) {
289+ all_files_exist = false ;
290+
291+ if tcx. sess . opts . debugging_opts . incremental_info {
292+ println ! ( "incremental: could not find file for up-to-date work product: {}" ,
293+ path. display( ) ) ;
294+ }
295+ }
296+ }
297+
288298 if all_files_exist {
289299 debug ! ( "reconcile_work_products: all files for {:?} exist" , swp) ;
290300 tcx. dep_graph . insert_previous_work_product ( & swp. id , swp. work_product ) ;
@@ -331,7 +341,7 @@ fn load_prev_metadata_hashes(tcx: TyCtxt,
331341
332342 debug ! ( "load_prev_metadata_hashes() - File: {}" , file_path. display( ) ) ;
333343
334- let data = match file_format:: read_file ( & file_path) {
344+ let data = match file_format:: read_file ( tcx . sess , & file_path) {
335345 Ok ( Some ( data) ) => data,
336346 Ok ( None ) => {
337347 debug ! ( "load_prev_metadata_hashes() - File produced by incompatible \
0 commit comments