about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl
diff options
context:
space:
mode:
authorklensy <klensy@users.noreply.github.com>2024-11-02 15:20:11 +0300
committerklensy <klensy@users.noreply.github.com>2024-11-03 15:51:39 +0300
commitbc1d8e72e793c61c4c22867e0802835178b8a309 (patch)
tree949de75371e5e6d33321e51e30b64ce93ef0ab17 /compiler/rustc_driver_impl
parentbe3a635fe777d4aac653994749ad47e650e71c1e (diff)
downloadrust-bc1d8e72e793c61c4c22867e0802835178b8a309.tar.gz
rust-bc1d8e72e793c61c4c22867e0802835178b8a309.zip
make time format parsing compiletime
Diffstat (limited to 'compiler/rustc_driver_impl')
-rw-r--r--compiler/rustc_driver_impl/Cargo.toml2
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml
index ef577c03218..74da0d11e4b 100644
--- a/compiler/rustc_driver_impl/Cargo.toml
+++ b/compiler/rustc_driver_impl/Cargo.toml
@@ -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
 
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 4362007d4ba..d2c4335cf2b 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -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();