Skip to content

Commit 5d3fc6f

Browse files
committed
Deny warnings in test modules
1 parent 8c05a15 commit 5d3fc6f

7 files changed

+23
-0
lines changed

tests/compile-test.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![feature(test)] // compiletest_rs requires this attribute
22
#![feature(once_cell)]
3+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
4+
#![warn(rust_2018_idioms, unused_lifetimes)]
35

46
use compiletest_rs as compiletest;
57
use compiletest_rs::common::Mode as TestMode;
@@ -31,11 +33,17 @@ static TEST_DEPENDENCIES: &[&str] = &[
3133

3234
// Test dependencies may need an `extern crate` here to ensure that they show up
3335
// in the depinfo file (otherwise cargo thinks they are unused)
36+
#[allow(unused_extern_crates)]
3437
extern crate clippy_utils;
38+
#[allow(unused_extern_crates)]
3539
extern crate derive_new;
40+
#[allow(unused_extern_crates)]
3641
extern crate if_chain;
42+
#[allow(unused_extern_crates)]
3743
extern crate itertools;
44+
#[allow(unused_extern_crates)]
3845
extern crate quote;
46+
#[allow(unused_extern_crates)]
3947
extern crate syn;
4048

4149
fn host_lib() -> PathBuf {

tests/dogfood.rs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Dogfood cannot run on Windows
77
#![cfg(not(windows))]
88
#![feature(once_cell)]
9+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
10+
#![warn(rust_2018_idioms, unused_lifetimes)]
911

1012
use std::lazy::SyncLazy;
1113
use std::path::PathBuf;

tests/fmt.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
2+
#![warn(rust_2018_idioms, unused_lifetimes)]
3+
14
use std::path::PathBuf;
25
use std::process::Command;
36

tests/integration.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![cfg(feature = "integration")]
2+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
3+
#![warn(rust_2018_idioms, unused_lifetimes)]
24

35
use std::env;
46
use std::ffi::OsStr;

tests/lint_message_convention.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
2+
#![warn(rust_2018_idioms, unused_lifetimes)]
3+
14
use std::ffi::OsStr;
25
use std::path::PathBuf;
36

tests/missing-test-files.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
2+
#![warn(rust_2018_idioms, unused_lifetimes)]
13
#![allow(clippy::assertions_on_constants)]
24

35
use std::fs::{self, DirEntry};

tests/versioncheck.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
2+
#![warn(rust_2018_idioms, unused_lifetimes)]
13
#![allow(clippy::single_match_else)]
4+
25
use rustc_tools_util::VersionInfo;
36

47
#[test]

0 commit comments

Comments
 (0)