Skip to content

Commit 12b11d8

Browse files
Print -Zincremental-info to stderr instead of stdout.
1 parent 80271e8 commit 12b11d8

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/librustc_incremental/persist/file_format.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ fn report_format_mismatch(sess: &Session, file: &Path, message: &str) {
117117
debug!("read_file: {}", message);
118118

119119
if sess.opts.debugging_opts.incremental_info {
120-
println!("incremental: ignoring cache artifact `{}`: {}",
121-
file.file_name().unwrap().to_string_lossy(),
122-
message);
120+
eprintln!("incremental: ignoring cache artifact `{}`: {}",
121+
file.file_name().unwrap().to_string_lossy(),
122+
message);
123123
}
124124
}
125125

src/librustc_incremental/persist/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ fn copy_files(target_dir: &Path,
435435
}
436436

437437
if print_stats_on_success {
438-
println!("incremental: session directory: {} files hard-linked", files_linked);
439-
println!("incremental: session directory: {} files copied", files_copied);
438+
eprintln!("incremental: session directory: {} files hard-linked", files_linked);
439+
eprintln!("incremental: session directory: {} files copied", files_copied);
440440
}
441441

442442
Ok(files_linked > 0 || files_copied == 0)

src/librustc_incremental/persist/load.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ pub fn decode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
151151

152152
if prev_commandline_args_hash != tcx.sess.opts.dep_tracking_hash() {
153153
if tcx.sess.opts.debugging_opts.incremental_info {
154-
println!("incremental: completely ignoring cache because of \
155-
differing commandline arguments");
154+
eprintln!("incremental: completely ignoring cache because of \
155+
differing commandline arguments");
156156
}
157157
// We can't reuse the cache, purge it.
158158
debug!("decode_dep_graph: differing commandline arg hashes");
@@ -309,8 +309,8 @@ fn reconcile_work_products<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
309309
all_files_exist = false;
310310

311311
if tcx.sess.opts.debugging_opts.incremental_info {
312-
println!("incremental: could not find file for up-to-date work product: {}",
313-
path.display());
312+
eprintln!("incremental: could not find file for \
313+
up-to-date work product: {}", path.display());
314314
}
315315
}
316316
}
@@ -418,10 +418,10 @@ fn process_edge<'a, 'tcx, 'edges>(
418418
format!("{:?}", blame)
419419
};
420420

421-
println!("incremental: module {:?} is dirty because {:?} \
422-
changed or was removed",
423-
wp_id,
424-
blame_str);
421+
eprintln!("incremental: module {:?} is dirty because {:?} \
422+
changed or was removed",
423+
wp_id,
424+
blame_str);
425425
}
426426
}
427427
}

src/librustc_incremental/persist/save.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
4747
let query = tcx.dep_graph.query();
4848

4949
if tcx.sess.opts.debugging_opts.incremental_info {
50-
println!("incremental: {} nodes in dep-graph", query.graph.len_nodes());
51-
println!("incremental: {} edges in dep-graph", query.graph.len_edges());
50+
eprintln!("incremental: {} nodes in dep-graph", query.graph.len_nodes());
51+
eprintln!("incremental: {} edges in dep-graph", query.graph.len_edges());
5252
}
5353

5454
let mut hcx = HashContext::new(tcx, incremental_hashes_map);
@@ -258,9 +258,9 @@ pub fn encode_dep_graph(tcx: TyCtxt,
258258
graph.encode(encoder)?;
259259

260260
if tcx.sess.opts.debugging_opts.incremental_info {
261-
println!("incremental: {} nodes in reduced dep-graph", graph.nodes.len());
262-
println!("incremental: {} edges in serialized dep-graph", graph.edge_list_data.len());
263-
println!("incremental: {} hashes in serialized dep-graph", graph.hashes.len());
261+
eprintln!("incremental: {} nodes in reduced dep-graph", graph.nodes.len());
262+
eprintln!("incremental: {} edges in serialized dep-graph", graph.edge_list_data.len());
263+
eprintln!("incremental: {} hashes in serialized dep-graph", graph.hashes.len());
264264
}
265265

266266
if tcx.sess.opts.debugging_opts.incremental_dump_hash {

src/librustc_trans/back/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ fn dump_incremental_data(trans: &CrateTranslation) {
893893
ModuleSource::Translated(..) => (),
894894
}
895895
}
896-
println!("incremental: re-using {} out of {} modules", reuse, trans.modules.len());
896+
eprintln!("incremental: re-using {} out of {} modules", reuse, trans.modules.len());
897897
}
898898

899899
struct WorkItem {

src/librustc_trans/base.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,9 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
11501150
Some(work_product)
11511151
} else {
11521152
if scx.sess().opts.debugging_opts.incremental_info {
1153-
println!("incremental: CGU `{}` invalidated because of \
1154-
changed partitioning hash.",
1155-
cgu.name());
1153+
eprintln!("incremental: CGU `{}` invalidated because of \
1154+
changed partitioning hash.",
1155+
cgu.name());
11561156
}
11571157
debug!("trans_reuse_previous_work_products: \
11581158
not reusing {:?} because hash changed to {:?}",

0 commit comments

Comments
 (0)