@@ -30,7 +30,7 @@ use std::path::{Path, PathBuf};
30
30
use std:: process:: { self , Command , Stdio } ;
31
31
use std:: sync:: OnceLock ;
32
32
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
33
- use std:: time:: { Instant , SystemTime } ;
33
+ use std:: time:: Instant ;
34
34
use std:: { env, str} ;
35
35
36
36
use rustc_ast as ast;
@@ -66,8 +66,6 @@ use rustc_session::{EarlyDiagCtxt, Session, config, filesearch};
66
66
use rustc_span:: FileName ;
67
67
use rustc_target:: json:: ToJson ;
68
68
use rustc_target:: spec:: { Target , TargetTuple } ;
69
- use time:: OffsetDateTime ;
70
- use time:: macros:: format_description;
71
69
use tracing:: trace;
72
70
73
71
#[ allow( unused_macros) ]
@@ -1304,13 +1302,10 @@ fn ice_path_with_config(config: Option<&UnstableOptions>) -> &'static Option<Pat
1304
1302
. or_else( || std:: env:: current_dir( ) . ok( ) )
1305
1303
. unwrap_or_default( ) ,
1306
1304
} ;
1307
- let now: OffsetDateTime = SystemTime :: now( ) . into( ) ;
1308
- let file_now = now
1309
- . format(
1310
- // Don't use a standard datetime format because Windows doesn't support `:` in paths
1311
- & format_description!( "[year]-[month]-[day]T[hour]_[minute]_[second]" ) ,
1312
- )
1313
- . unwrap_or_default( ) ;
1305
+ let now = jiff:: Timestamp :: now( ) ;
1306
+ let zdt = now. to_zoned( jiff:: tz:: TimeZone :: system( ) ) ;
1307
+ // Don't use a standard datetime format because Windows doesn't support `:` in paths
1308
+ let file_now = zdt. strftime( "%Y-%m-%dT%H_%M_%S" ) ;
1314
1309
let pid = std:: process:: id( ) ;
1315
1310
path. push( format!( "rustc-ice-{file_now}-{pid}.txt" ) ) ;
1316
1311
Some ( path)
0 commit comments