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]