Skip to content

Commit b172749

Browse files
authored
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.
2 parents 17a13bc + b45cb09 commit b172749

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bootstrap/compile.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use std::process::{exit, Command, Stdio};
1717
use std::str;
1818

1919
use build_helper::{output, t, up_to_date};
20-
use filetime::FileTime;
2120
use serde::Deserialize;
2221

2322
use crate::builder::Cargo;
@@ -1334,8 +1333,9 @@ pub fn run_cargo(
13341333
.map(|s| s.starts_with('-') && s.ends_with(&extension[..]))
13351334
.unwrap_or(false)
13361335
});
1337-
let max = candidates
1338-
.max_by_key(|&&(_, _, ref metadata)| FileTime::from_last_modification_time(metadata));
1336+
let max = candidates.max_by_key(|&&(_, _, ref metadata)| {
1337+
metadata.modified().expect("mtime should be available on all relevant OSes")
1338+
});
13391339
let path_to_add = match max {
13401340
Some(triple) => triple.0.to_str().unwrap(),
13411341
None => panic!("no output generated for {:?} {:?}", prefix, extension),

0 commit comments

Comments
 (0)