From c9abc7e2bbed4afca2e7c8de7c7334d0a3724bb8 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Mon, 30 Aug 2021 14:41:09 +0200 Subject: [PATCH] Remove print_fuel_crate field of Session --- compiler/rustc_driver/src/lib.rs | 4 ++-- compiler/rustc_session/src/session.rs | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index fcc70b2e4c5..53053327d0d 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -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) ); } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 89fa0d6dd99..f29275bffc4 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -173,9 +173,6 @@ pub struct Session { /// Tracks fuel info if `-zfuel=crate=n` is specified. optimization_fuel: Lock, - // The next two are public because the driver needs to read them. - /// If `-zprint-fuel=crate`, `Some(crate)`. - pub print_fuel_crate: Option, /// Always set to zero and incremented so that we can print fuel expended by a crate. pub print_fuel: AtomicU64, @@ -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); @@ -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 { @@ -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,