Skip to content

Commit 4eae9b1

Browse files
committed
make time format parsing compiletime
1 parent 7abae78 commit 4eae9b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_driver_impl/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
4949
rustc_ty_utils = { path = "../rustc_ty_utils" }
5050
serde_json = "1.0.59"
5151
shlex = "1.0"
52-
time = { version = "0.3.36", default-features = false, features = ["alloc", "formatting", "parsing", "macros"] }
52+
time = { version = "0.3.36", default-features = false, features = ["alloc", "formatting", "macros"] }
5353
tracing = { version = "0.1.35" }
5454
# tidy-alphabetical-end
5555

compiler/rustc_driver_impl/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ use rustc_span::source_map::FileLoader;
6363
use rustc_target::json::ToJson;
6464
use rustc_target::spec::{Target, TargetTriple};
6565
use time::OffsetDateTime;
66+
use time::macros::format_description;
6667
use tracing::trace;
6768

6869
#[allow(unused_macros)]
@@ -1355,8 +1356,7 @@ fn ice_path_with_config(config: Option<&UnstableOptions>) -> &'static Option<Pat
13551356
let file_now = now
13561357
.format(
13571358
// Don't use a standard datetime format because Windows doesn't support `:` in paths
1358-
&time::format_description::parse("[year]-[month]-[day]T[hour]_[minute]_[second]")
1359-
.unwrap(),
1359+
&format_description!("[year]-[month]-[day]T[hour]_[minute]_[second]"),
13601360
)
13611361
.unwrap_or_default();
13621362
let pid = std::process::id();

0 commit comments

Comments
 (0)