@@ -170,15 +170,9 @@ pub struct Session {
170170 /// Data about code being compiled, gathered during compilation.
171171 pub code_stats : CodeStats ,
172172
173- /// If `-zfuel=crate=n` is specified, `Some(crate)`.
174- optimization_fuel_crate : Option < String > ,
175-
176173 /// Tracks fuel info if `-zfuel=crate=n` is specified.
177174 optimization_fuel : Lock < OptimizationFuel > ,
178175
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 > ,
182176 /// Always set to zero and incremented so that we can print fuel expended by a crate.
183177 pub print_fuel : AtomicU64 ,
184178
@@ -196,6 +190,9 @@ pub struct Session {
196190 /// Tracks the current behavior of the CTFE engine when an error occurs.
197191 /// Options range from returning the error without a backtrace to returning an error
198192 /// 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.
199196 pub ctfe_backtrace : Lock < CtfeBacktrace > ,
200197
201198 /// This tracks where `-Zunleash-the-miri-inside-of-you` was used to get around a
@@ -890,7 +887,7 @@ impl Session {
890887 /// This expends fuel if applicable, and records fuel if applicable.
891888 pub fn consider_optimizing < T : Fn ( ) -> String > ( & self , crate_name : & str , msg : T ) -> bool {
892889 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 ) {
894891 if c == crate_name {
895892 assert_eq ! ( self . threads( ) , 1 ) ;
896893 let mut fuel = self . optimization_fuel . lock ( ) ;
@@ -903,7 +900,7 @@ impl Session {
903900 }
904901 }
905902 }
906- if let Some ( ref c) = self . print_fuel_crate {
903+ if let Some ( ref c) = self . opts . debugging_opts . print_fuel {
907904 if c == crate_name {
908905 assert_eq ! ( self . threads( ) , 1 ) ;
909906 self . print_fuel . fetch_add ( 1 , SeqCst ) ;
@@ -1261,12 +1258,10 @@ pub fn build_session(
12611258 let local_crate_source_file =
12621259 local_crate_source_file. map ( |path| file_path_mapping. map_prefix ( path) . 0 ) ;
12631260
1264- let optimization_fuel_crate = sopts. debugging_opts . fuel . as_ref ( ) . map ( |i| i. 0 . clone ( ) ) ;
12651261 let optimization_fuel = Lock :: new ( OptimizationFuel {
12661262 remaining : sopts. debugging_opts . fuel . as_ref ( ) . map_or ( 0 , |i| i. 1 ) ,
12671263 out_of_fuel : false ,
12681264 } ) ;
1269- let print_fuel_crate = sopts. debugging_opts . print_fuel . clone ( ) ;
12701265 let print_fuel = AtomicU64 :: new ( 0 ) ;
12711266
12721267 let cgu_reuse_tracker = if sopts. debugging_opts . query_dep_graph {
@@ -1314,9 +1309,7 @@ pub fn build_session(
13141309 normalize_projection_ty : AtomicUsize :: new ( 0 ) ,
13151310 } ,
13161311 code_stats : Default :: default ( ) ,
1317- optimization_fuel_crate,
13181312 optimization_fuel,
1319- print_fuel_crate,
13201313 print_fuel,
13211314 jobserver : jobserver:: client ( ) ,
13221315 driver_lint_caps,
0 commit comments