about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCameron Steffen <cam.steffen94@gmail.com>2021-09-08 08:19:14 -0500
committerCameron Steffen <cam.steffen94@gmail.com>2021-09-08 08:21:06 -0500
commit5d3fc6fc08d604889e5c52ad8b38ea474fab9a6f (patch)
treebdc55a6118485eb026aa107a565cb6747d2a1150
parent8c05a15f0a5b541a5eb29f88f2d6dffa5888a2ce (diff)
downloadrust-5d3fc6fc08d604889e5c52ad8b38ea474fab9a6f.tar.gz
rust-5d3fc6fc08d604889e5c52ad8b38ea474fab9a6f.zip
Deny warnings in test modules
-rw-r--r--tests/compile-test.rs8
-rw-r--r--tests/dogfood.rs2
-rw-r--r--tests/fmt.rs3
-rw-r--r--tests/integration.rs2
-rw-r--r--tests/lint_message_convention.rs3
-rw-r--r--tests/missing-test-files.rs2
-rw-r--r--tests/versioncheck.rs3
7 files changed, 23 insertions, 0 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 74fe6f548a1..c63c47690d5 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -1,5 +1,7 @@
 #![feature(test)] // compiletest_rs requires this attribute
 #![feature(once_cell)]
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
 
 use compiletest_rs as compiletest;
 use compiletest_rs::common::Mode as TestMode;
@@ -31,11 +33,17 @@ static TEST_DEPENDENCIES: &[&str] = &[
 
 // Test dependencies may need an `extern crate` here to ensure that they show up
 // in the depinfo file (otherwise cargo thinks they are unused)
+#[allow(unused_extern_crates)]
 extern crate clippy_utils;
+#[allow(unused_extern_crates)]
 extern crate derive_new;
+#[allow(unused_extern_crates)]
 extern crate if_chain;
+#[allow(unused_extern_crates)]
 extern crate itertools;
+#[allow(unused_extern_crates)]
 extern crate quote;
+#[allow(unused_extern_crates)]
 extern crate syn;
 
 fn host_lib() -> PathBuf {
diff --git a/tests/dogfood.rs b/tests/dogfood.rs
index 4ede20c5258..54f452172de 100644
--- a/tests/dogfood.rs
+++ b/tests/dogfood.rs
@@ -6,6 +6,8 @@
 // Dogfood cannot run on Windows
 #![cfg(not(windows))]
 #![feature(once_cell)]
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
 
 use std::lazy::SyncLazy;
 use std::path::PathBuf;
diff --git a/tests/fmt.rs b/tests/fmt.rs
index 7616d8001e8..be42f1fbb20 100644
--- a/tests/fmt.rs
+++ b/tests/fmt.rs
@@ -1,3 +1,6 @@
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
+
 use std::path::PathBuf;
 use std::process::Command;
 
diff --git a/tests/integration.rs b/tests/integration.rs
index 1718089e8bd..7e3eff3c732 100644
--- a/tests/integration.rs
+++ b/tests/integration.rs
@@ -1,4 +1,6 @@
 #![cfg(feature = "integration")]
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
 
 use std::env;
 use std::ffi::OsStr;
diff --git a/tests/lint_message_convention.rs b/tests/lint_message_convention.rs
index 2f8989c8e11..b4d94dc983f 100644
--- a/tests/lint_message_convention.rs
+++ b/tests/lint_message_convention.rs
@@ -1,3 +1,6 @@
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
+
 use std::ffi::OsStr;
 use std::path::PathBuf;
 
diff --git a/tests/missing-test-files.rs b/tests/missing-test-files.rs
index 9cef7438d22..bd342e390f5 100644
--- a/tests/missing-test-files.rs
+++ b/tests/missing-test-files.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
 #![allow(clippy::assertions_on_constants)]
 
 use std::fs::{self, DirEntry};
diff --git a/tests/versioncheck.rs b/tests/versioncheck.rs
index 1eaec4a50a6..77102b8cac0 100644
--- a/tests/versioncheck.rs
+++ b/tests/versioncheck.rs
@@ -1,4 +1,7 @@
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
 #![allow(clippy::single_match_else)]
+
 use rustc_tools_util::VersionInfo;
 
 #[test]