diff options
| author | bors <bors@rust-lang.org> | 2019-05-17 00:55:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-17 00:55:01 +0000 |
| commit | 1bbb1353beac929cb5226d7c0cce95c9d0c021bb (patch) | |
| tree | 9e1badb00f6b3b89b907801b66d6343e3ef806eb /src/tools | |
| parent | 4f53b5c42baf498b0dd8adbe59aae648a2cf6c14 (diff) | |
| parent | a80a1d0e0d0d9cd47fe6070a7450fa81ccd0856d (diff) | |
| download | rust-1bbb1353beac929cb5226d7c0cce95c9d0c021bb.tar.gz rust-1bbb1353beac929cb5226d7c0cce95c9d0c021bb.zip | |
Auto merge of #60898 - Centril:rollup-76o2g8a, r=Centril
Rollup of 6 pull requests Successful merges: - #60685 (Switch to SPDX 2.1 license expression) - #60687 (Fix .natvis visualizers.) - #60805 (remove compiletest's dependency on `filetime`) - #60862 (Get ty from local_decls instead of using Place) - #60873 (Parse alternative incorrect uses of await and recover) - #60894 (Add entry-like methods to HashSet) Failed merges: r? @ghost
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/compiletest/Cargo.toml | 1 | ||||
| -rw-r--r-- | src/tools/compiletest/src/main.rs | 27 | ||||
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 3 | ||||
| -rw-r--r-- | src/tools/rustbook/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/rustc-std-workspace-alloc/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/rustc-std-workspace-core/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/rustc-workspace-hack/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/unstable-book-gen/Cargo.toml | 2 |
8 files changed, 22 insertions, 19 deletions
diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index 336d7e32024..e759ad1f35d 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" [dependencies] diff = "0.1.10" env_logger = { version = "0.5", default-features = false } -filetime = "0.2" getopts = "0.2" log = "0.4" regex = "1.0" diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index e253934e566..442e58bfd74 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -9,7 +9,6 @@ use crate::common::CompareMode; use crate::common::{expected_output_path, output_base_dir, output_relative_path, UI_EXTENSIONS}; use crate::common::{Config, TestPaths}; use crate::common::{DebugInfoBoth, DebugInfoGdb, DebugInfoLldb, Mode, Pretty}; -use filetime::FileTime; use getopts::Options; use std::env; use std::ffi::OsString; @@ -17,6 +16,7 @@ use std::fs; use std::io::{self, ErrorKind}; use std::path::{Path, PathBuf}; use std::process::Command; +use std::time::SystemTime; use test::ColorConfig; use crate::util::logv; use walkdir::WalkDir; @@ -752,31 +752,36 @@ fn up_to_date( #[derive(Debug, PartialEq, PartialOrd, Ord, Eq)] struct Stamp { - time: FileTime, + time: SystemTime, file: PathBuf, } impl Stamp { fn from_path(p: &Path) -> Self { + let time = fs::metadata(p) + .and_then(|metadata| metadata.modified()) + .unwrap_or(SystemTime::UNIX_EPOCH); + Stamp { - time: mtime(&p), + time, file: p.into(), } } - fn from_dir(path: &Path) -> impl Iterator<Item=Stamp> { + fn from_dir(path: &Path) -> impl Iterator<Item = Stamp> { WalkDir::new(path) .into_iter() .map(|entry| entry.unwrap()) .filter(|entry| entry.file_type().is_file()) - .map(|entry| Stamp::from_path(entry.path())) - } -} + .map(|entry| { + let time = (|| -> io::Result<_> { entry.metadata()?.modified() })(); -fn mtime(path: &Path) -> FileTime { - fs::metadata(path) - .map(|f| FileTime::from_last_modification_time(&f)) - .unwrap_or_else(|_| FileTime::zero()) + Stamp { + time: time.unwrap_or(SystemTime::UNIX_EPOCH), + file: entry.path().into(), + } + }) + } } fn make_test_name( diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index b335fe3ae18..1e4deee6bf1 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -9,7 +9,6 @@ use crate::common::{Config, TestPaths}; use crate::common::{Incremental, MirOpt, RunMake, Ui, JsDocTest, Assembly}; use diff; use crate::errors::{self, Error, ErrorKind}; -use filetime::FileTime; use crate::header::TestProps; use crate::json; use regex::{Captures, Regex}; @@ -3029,7 +3028,7 @@ impl<'test> TestCx<'test> { } fn check_mir_test_timestamp(&self, test_name: &str, output_file: &Path) { - let t = |file| FileTime::from_last_modification_time(&fs::metadata(file).unwrap()); + let t = |file| fs::metadata(file).unwrap().modified().unwrap(); let source_file = &self.testpaths.file; let output_time = t(output_file); let source_time = t(source_file); diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index 5bf1553b227..d2b1a7bac60 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Rust Project Developers"] name = "rustbook" version = "0.1.0" -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" edition = "2018" [dependencies] diff --git a/src/tools/rustc-std-workspace-alloc/Cargo.toml b/src/tools/rustc-std-workspace-alloc/Cargo.toml index 98578914963..05df1fddc7f 100644 --- a/src/tools/rustc-std-workspace-alloc/Cargo.toml +++ b/src/tools/rustc-std-workspace-alloc/Cargo.toml @@ -2,7 +2,7 @@ name = "rustc-std-workspace-alloc" version = "1.0.0" authors = ["Alex Crichton <alex@alexcrichton.com>"] -license = 'MIT/Apache-2.0' +license = 'MIT OR Apache-2.0' description = """ Hack for the compiler's own build system """ diff --git a/src/tools/rustc-std-workspace-core/Cargo.toml b/src/tools/rustc-std-workspace-core/Cargo.toml index d527ce12bc3..38ca56a557b 100644 --- a/src/tools/rustc-std-workspace-core/Cargo.toml +++ b/src/tools/rustc-std-workspace-core/Cargo.toml @@ -2,7 +2,7 @@ name = "rustc-std-workspace-core" version = "1.0.0" authors = ["Alex Crichton <alex@alexcrichton.com>"] -license = 'MIT/Apache-2.0' +license = 'MIT OR Apache-2.0' description = """ Hack for the compiler's own build system """ diff --git a/src/tools/rustc-workspace-hack/Cargo.toml b/src/tools/rustc-workspace-hack/Cargo.toml index d51841cd650..290c4481c00 100644 --- a/src/tools/rustc-workspace-hack/Cargo.toml +++ b/src/tools/rustc-workspace-hack/Cargo.toml @@ -2,7 +2,7 @@ name = "rustc-workspace-hack" version = "1.0.0" authors = ["Alex Crichton <alex@alexcrichton.com>"] -license = 'MIT/Apache-2.0' +license = 'MIT OR Apache-2.0' description = """ Hack for the compiler's own build system """ diff --git a/src/tools/unstable-book-gen/Cargo.toml b/src/tools/unstable-book-gen/Cargo.toml index 3209de09aeb..e43e4e6c7cb 100644 --- a/src/tools/unstable-book-gen/Cargo.toml +++ b/src/tools/unstable-book-gen/Cargo.toml @@ -3,7 +3,7 @@ authors = ["est31 <MTest31@outlook.com>", "The Rust Project Developers"] name = "unstable-book-gen" version = "0.1.0" -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" edition = "2018" [dependencies] |
