Skip to content

Commit

Permalink
Remove print_fuel_crate field of Session
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Sep 2, 2021
1 parent 5464b2e commit c9abc7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_driver/src/lib.rs
Expand Up @@ -423,10 +423,10 @@ fn run_compiler(
sess.print_perf_stats();
}

if sess.print_fuel_crate.is_some() {
if sess.opts.debugging_opts.print_fuel.is_some() {
eprintln!(
"Fuel used by {}: {}",
sess.print_fuel_crate.as_ref().unwrap(),
sess.opts.debugging_opts.print_fuel.as_ref().unwrap(),
sess.print_fuel.load(SeqCst)
);
}
Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_session/src/session.rs
Expand Up @@ -173,9 +173,6 @@ pub struct Session {
/// Tracks fuel info if `-zfuel=crate=n` is specified.
optimization_fuel: Lock<OptimizationFuel>,

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

Expand Down Expand Up @@ -900,7 +897,7 @@ impl Session {
}
}
}
if let Some(ref c) = self.print_fuel_crate {
if let Some(ref c) = self.opts.debugging_opts.print_fuel {
if c == crate_name {
assert_eq!(self.threads(), 1);
self.print_fuel.fetch_add(1, SeqCst);
Expand Down Expand Up @@ -1262,7 +1259,6 @@ pub fn build_session(
remaining: sopts.debugging_opts.fuel.as_ref().map_or(0, |i| i.1),
out_of_fuel: false,
});
let print_fuel_crate = sopts.debugging_opts.print_fuel.clone();
let print_fuel = AtomicU64::new(0);

let cgu_reuse_tracker = if sopts.debugging_opts.query_dep_graph {
Expand Down Expand Up @@ -1311,7 +1307,6 @@ pub fn build_session(
},
code_stats: Default::default(),
optimization_fuel,
print_fuel_crate,
print_fuel,
jobserver: jobserver::client(),
driver_lint_caps,
Expand Down

0 comments on commit c9abc7e

Please sign in to comment.