From 1ac470f70c9de77cbd5fd6e5c5a624e55af81fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Wed, 13 Nov 2019 00:00:00 +0000 Subject: [PATCH] compiletest: Avoid double negation in ignore condition --- src/tools/compiletest/src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 241a1aeec6e..1cbf44287e1 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -731,7 +731,8 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec) -> Path output_base_dir(config, testpaths, revision).join("stamp") } -fn is_outdated( +fn is_up_to_date( config: &Config, testpaths: &TestPaths, props: &EarlyProps, @@ -768,11 +769,11 @@ fn is_outdated( let contents = match fs::read_to_string(&stamp_name) { Ok(f) => f, Err(ref e) if e.kind() == ErrorKind::InvalidData => panic!("Can't read stamp contents"), - Err(_) => return true, + Err(_) => return false, }; let expected_hash = runtest::compute_stamp_hash(config); if contents != expected_hash { - return true; + return false; } // Check timestamps. @@ -793,7 +794,7 @@ fn is_outdated( inputs.add_path(path); } - inputs > Stamp::from_path(&stamp_name) + inputs < Stamp::from_path(&stamp_name) } #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]