Skip to content

Commit 742ee9d

Browse files
authored
Rollup merge of rust-lang#89322 - tmiasko:rm-optimization-fuel, r=michaelwoerister
Reapply "Remove optimization_fuel_crate from Session"
2 parents 1826030 + 42e9dfd commit 742ee9d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/rustc_session/src/session.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@ pub struct Session {
162162
/// Data about code being compiled, gathered during compilation.
163163
pub code_stats: CodeStats,
164164

165-
/// If `-zfuel=crate=n` is specified, `Some(crate)`.
166-
optimization_fuel_crate: Option<String>,
167-
168165
/// Tracks fuel info if `-zfuel=crate=n` is specified.
169166
optimization_fuel: Lock<OptimizationFuel>,
170167

@@ -882,7 +879,7 @@ impl Session {
882879
/// This expends fuel if applicable, and records fuel if applicable.
883880
pub fn consider_optimizing<T: Fn() -> String>(&self, crate_name: &str, msg: T) -> bool {
884881
let mut ret = true;
885-
if let Some(ref c) = self.optimization_fuel_crate {
882+
if let Some((ref c, _)) = self.opts.debugging_opts.fuel {
886883
if c == crate_name {
887884
assert_eq!(self.threads(), 1);
888885
let mut fuel = self.optimization_fuel.lock();
@@ -1260,7 +1257,6 @@ pub fn build_session(
12601257
let local_crate_source_file =
12611258
local_crate_source_file.map(|path| file_path_mapping.map_prefix(path).0);
12621259

1263-
let optimization_fuel_crate = sopts.debugging_opts.fuel.as_ref().map(|i| i.0.clone());
12641260
let optimization_fuel = Lock::new(OptimizationFuel {
12651261
remaining: sopts.debugging_opts.fuel.as_ref().map_or(0, |i| i.1),
12661262
out_of_fuel: false,
@@ -1311,7 +1307,6 @@ pub fn build_session(
13111307
normalize_projection_ty: AtomicUsize::new(0),
13121308
},
13131309
code_stats: Default::default(),
1314-
optimization_fuel_crate,
13151310
optimization_fuel,
13161311
print_fuel,
13171312
jobserver: jobserver::client(),

0 commit comments

Comments
 (0)