mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Don't print opt fuel messages to stdout because it breaks Rustbuild
Rustbuild passes `--message-format json` to the compiler invocations which causes JSON to be emitted on stdout. Printing optimization fuel messages to stdout breaks the json and causes Rustbuild to fail. Work around this by emitting optimization fuel related messages on stderr instead.
This commit is contained in:
@@ -868,7 +868,7 @@ pub fn consider_optimizing<T: Fn() -> String>(&self, crate_name: &str, msg: T) -
|
||||
let fuel = self.optimization_fuel_limit.get();
|
||||
ret = fuel != 0;
|
||||
if fuel == 0 && !self.out_of_fuel.get() {
|
||||
println!("optimization-fuel-exhausted: {}", msg());
|
||||
eprintln!("optimization-fuel-exhausted: {}", msg());
|
||||
self.out_of_fuel.set(true);
|
||||
} else if fuel > 0 {
|
||||
self.optimization_fuel_limit.set(fuel - 1);
|
||||
|
||||
@@ -944,7 +944,7 @@ fn build_controller(self: Box<Self>,
|
||||
control.compilation_done.callback = box move |state| {
|
||||
old_callback(state);
|
||||
let sess = state.session;
|
||||
println!("Fuel used by {}: {}",
|
||||
eprintln!("Fuel used by {}: {}",
|
||||
sess.print_fuel_crate.as_ref().unwrap(),
|
||||
sess.print_fuel.get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user