Skip to content

Commit c9abc7e

Browse files
committed
Remove print_fuel_crate field of Session
1 parent 5464b2e commit c9abc7e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

compiler/rustc_driver/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@ fn run_compiler(
423423
sess.print_perf_stats();
424424
}
425425

426-
if sess.print_fuel_crate.is_some() {
426+
if sess.opts.debugging_opts.print_fuel.is_some() {
427427
eprintln!(
428428
"Fuel used by {}: {}",
429-
sess.print_fuel_crate.as_ref().unwrap(),
429+
sess.opts.debugging_opts.print_fuel.as_ref().unwrap(),
430430
sess.print_fuel.load(SeqCst)
431431
);
432432
}

compiler/rustc_session/src/session.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ pub struct Session {
173173
/// Tracks fuel info if `-zfuel=crate=n` is specified.
174174
optimization_fuel: Lock<OptimizationFuel>,
175175

176-
// The next two are public because the driver needs to read them.
177-
/// If `-zprint-fuel=crate`, `Some(crate)`.
178-
pub print_fuel_crate: Option<String>,
179176
/// Always set to zero and incremented so that we can print fuel expended by a crate.
180177
pub print_fuel: AtomicU64,
181178

@@ -900,7 +897,7 @@ impl Session {
900897
}
901898
}
902899
}
903-
if let Some(ref c) = self.print_fuel_crate {
900+
if let Some(ref c) = self.opts.debugging_opts.print_fuel {
904901
if c == crate_name {
905902
assert_eq!(self.threads(), 1);
906903
self.print_fuel.fetch_add(1, SeqCst);
@@ -1262,7 +1259,6 @@ pub fn build_session(
12621259
remaining: sopts.debugging_opts.fuel.as_ref().map_or(0, |i| i.1),
12631260
out_of_fuel: false,
12641261
});
1265-
let print_fuel_crate = sopts.debugging_opts.print_fuel.clone();
12661262
let print_fuel = AtomicU64::new(0);
12671263

12681264
let cgu_reuse_tracker = if sopts.debugging_opts.query_dep_graph {
@@ -1311,7 +1307,6 @@ pub fn build_session(
13111307
},
13121308
code_stats: Default::default(),
13131309
optimization_fuel,
1314-
print_fuel_crate,
13151310
print_fuel,
13161311
jobserver: jobserver::client(),
13171312
driver_lint_caps,

0 commit comments

Comments
 (0)