mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
make time format parsing compiletime
This commit is contained in:
parent
be3a635fe7
commit
bc1d8e72e7
@ -49,7 +49,7 @@ 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", "parsing", "macros"] }
|
||||
time = { version = "0.3.36", default-features = false, features = ["alloc", "formatting", "macros"] }
|
||||
tracing = { version = "0.1.35" }
|
||||
# tidy-alphabetical-end
|
||||
|
||||
|
@ -64,6 +64,7 @@ use rustc_span::source_map::FileLoader;
|
||||
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)]
|
||||
@ -1356,8 +1357,7 @@ fn ice_path_with_config(config: Option<&UnstableOptions>) -> &'static Option<Pat
|
||||
let file_now = now
|
||||
.format(
|
||||
// Don't use a standard datetime format because Windows doesn't support `:` in paths
|
||||
&time::format_description::parse("[year]-[month]-[day]T[hour]_[minute]_[second]")
|
||||
.unwrap(),
|
||||
&format_description!("[year]-[month]-[day]T[hour]_[minute]_[second]"),
|
||||
)
|
||||
.unwrap_or_default();
|
||||
let pid = std::process::id();
|
||||
|
Loading…
Reference in New Issue
Block a user