@@ -170,15 +170,9 @@ pub struct Session {
170
170
/// Data about code being compiled, gathered during compilation.
171
171
pub code_stats : CodeStats ,
172
172
173
- /// If `-zfuel=crate=n` is specified, `Some(crate)`.
174
- optimization_fuel_crate : Option < String > ,
175
-
176
173
/// Tracks fuel info if `-zfuel=crate=n` is specified.
177
174
optimization_fuel : Lock < OptimizationFuel > ,
178
175
179
- // The next two are public because the driver needs to read them.
180
- /// If `-zprint-fuel=crate`, `Some(crate)`.
181
- pub print_fuel_crate : Option < String > ,
182
176
/// Always set to zero and incremented so that we can print fuel expended by a crate.
183
177
pub print_fuel : AtomicU64 ,
184
178
@@ -196,6 +190,9 @@ pub struct Session {
196
190
/// Tracks the current behavior of the CTFE engine when an error occurs.
197
191
/// Options range from returning the error without a backtrace to returning an error
198
192
/// and immediately printing the backtrace to stderr.
193
+ /// The `Lock` is only used by miri to allow setting `ctfe_backtrace` after analysis when
194
+ /// `MIRI_BACKTRACE` is set. This makes it only apply to miri's errors and not to all CTFE
195
+ /// errors.
199
196
pub ctfe_backtrace : Lock < CtfeBacktrace > ,
200
197
201
198
/// This tracks where `-Zunleash-the-miri-inside-of-you` was used to get around a
@@ -890,7 +887,7 @@ impl Session {
890
887
/// This expends fuel if applicable, and records fuel if applicable.
891
888
pub fn consider_optimizing < T : Fn ( ) -> String > ( & self , crate_name : & str , msg : T ) -> bool {
892
889
let mut ret = true ;
893
- if let Some ( ref c) = self . optimization_fuel_crate {
890
+ if let Some ( c) = self . opts . debugging_opts . fuel . as_ref ( ) . map ( |i| & i . 0 ) {
894
891
if c == crate_name {
895
892
assert_eq ! ( self . threads( ) , 1 ) ;
896
893
let mut fuel = self . optimization_fuel . lock ( ) ;
@@ -903,7 +900,7 @@ impl Session {
903
900
}
904
901
}
905
902
}
906
- if let Some ( ref c) = self . print_fuel_crate {
903
+ if let Some ( ref c) = self . opts . debugging_opts . print_fuel {
907
904
if c == crate_name {
908
905
assert_eq ! ( self . threads( ) , 1 ) ;
909
906
self . print_fuel . fetch_add ( 1 , SeqCst ) ;
@@ -1261,12 +1258,10 @@ pub fn build_session(
1261
1258
let local_crate_source_file =
1262
1259
local_crate_source_file. map ( |path| file_path_mapping. map_prefix ( path) . 0 ) ;
1263
1260
1264
- let optimization_fuel_crate = sopts. debugging_opts . fuel . as_ref ( ) . map ( |i| i. 0 . clone ( ) ) ;
1265
1261
let optimization_fuel = Lock :: new ( OptimizationFuel {
1266
1262
remaining : sopts. debugging_opts . fuel . as_ref ( ) . map_or ( 0 , |i| i. 1 ) ,
1267
1263
out_of_fuel : false ,
1268
1264
} ) ;
1269
- let print_fuel_crate = sopts. debugging_opts . print_fuel . clone ( ) ;
1270
1265
let print_fuel = AtomicU64 :: new ( 0 ) ;
1271
1266
1272
1267
let cgu_reuse_tracker = if sopts. debugging_opts . query_dep_graph {
@@ -1314,9 +1309,7 @@ pub fn build_session(
1314
1309
normalize_projection_ty : AtomicUsize :: new ( 0 ) ,
1315
1310
} ,
1316
1311
code_stats : Default :: default ( ) ,
1317
- optimization_fuel_crate,
1318
1312
optimization_fuel,
1319
- print_fuel_crate,
1320
1313
print_fuel,
1321
1314
jobserver : jobserver:: client ( ) ,
1322
1315
driver_lint_caps,
0 commit comments