1
Fork 0

Rollup merge of #139315 - clubby789:deranged-bump, r=Mark-Simulacrum

Switch `time` to `jiff` for time formatting in ICE dumps

Due to https://github.com/jhpratt/deranged/issues/21, Clippy, R-A and Miri currently fail to build if we bump to 0.4.1, pulled in via `time`. ~~Add some specific type annotations so we don't have to just pin it.~~

~~I can open 3 PRs to the tool repos if preferred, but I thought it might be easier to do this than to pin the transitive dep and go back and remove it once the changes are synced back.~~
This commit is contained in:
Chris Denton 2025-04-12 21:05:28 +00:00 committed by GitHub
commit 0149a43f8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 72 deletions

View file

@ -4,6 +4,7 @@ version = "0.0.0"
edition = "2024"
[dependencies]
jiff = { version = "0.2.5", default-features = false, features = ["std"] }
# tidy-alphabetical-start
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
@ -50,7 +51,6 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
serde_json = "1.0.59"
shlex = "1.0"
time = { version = "0.3.36", default-features = false, features = ["alloc", "formatting", "macros"] }
tracing = { version = "0.1.35" }
# tidy-alphabetical-end

View file

@ -30,7 +30,7 @@ use std::path::{Path, PathBuf};
use std::process::{self, Command, Stdio};
use std::sync::OnceLock;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Instant, SystemTime};
use std::time::Instant;
use std::{env, str};
use rustc_ast as ast;
@ -66,8 +66,6 @@ use rustc_span::FileName;
use rustc_span::def_id::LOCAL_CRATE;
use rustc_target::json::ToJson;
use rustc_target::spec::{Target, TargetTuple};
use time::OffsetDateTime;
use time::macros::format_description;
use tracing::trace;
#[allow(unused_macros)]
@ -1301,13 +1299,8 @@ fn ice_path_with_config(config: Option<&UnstableOptions>) -> &'static Option<Pat
.or_else(|| std::env::current_dir().ok())
.unwrap_or_default(),
};
let now: OffsetDateTime = SystemTime::now().into();
let file_now = now
.format(
// Don't use a standard datetime format because Windows doesn't support `:` in paths
&format_description!("[year]-[month]-[day]T[hour]_[minute]_[second]"),
)
.unwrap_or_default();
// Don't use a standard datetime format because Windows doesn't support `:` in paths
let file_now = jiff::Zoned::now().strftime("%Y-%m-%dT%H_%M_%S");
let pid = std::process::id();
path.push(format!("rustc-ice-{file_now}-{pid}.txt"));
Some(path)