diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-21 19:36:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-21 19:36:51 +0100 |
| commit | 3095743600316af3ef67728c14473867500b58a2 (patch) | |
| tree | 7145d4103f74f6a46d1dbed5318929b44d2be8fa | |
| parent | f639ba634b7f20ef25b5067ef9681e16a2110494 (diff) | |
| parent | b45cb09d3068f45d5b752ba46034c8dbc92138eb (diff) | |
| download | rust-3095743600316af3ef67728c14473867500b58a2.tar.gz rust-3095743600316af3ef67728c14473867500b58a2.zip | |
Rollup merge of #94190 - bjorn3:less_filetime, r=Mark-Simulacrum
Use Metadata::modified instead of FileTime::from_last_modification_ti… …me in run_cargo Metadata::modified works in all platforms supported by the filetime crate. This changes brings rustbuild a tiny bit closer towards dropping the filetime dependency.
| -rw-r--r-- | src/bootstrap/compile.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index e17de0ba49e..53226977fd8 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -17,7 +17,6 @@ use std::process::{exit, Command, Stdio}; use std::str; use build_helper::{output, t, up_to_date}; -use filetime::FileTime; use serde::Deserialize; use crate::builder::Cargo; @@ -1334,8 +1333,9 @@ pub fn run_cargo( .map(|s| s.starts_with('-') && s.ends_with(&extension[..])) .unwrap_or(false) }); - let max = candidates - .max_by_key(|&&(_, _, ref metadata)| FileTime::from_last_modification_time(metadata)); + let max = candidates.max_by_key(|&&(_, _, ref metadata)| { + metadata.modified().expect("mtime should be available on all relevant OSes") + }); let path_to_add = match max { Some(triple) => triple.0.to_str().unwrap(), None => panic!("no output generated for {:?} {:?}", prefix, extension), |
