Skip to content

Commit

Permalink
Deny warnings in test modules
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen committed Sep 8, 2021
1 parent 8c05a15 commit 5d3fc6f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/compile-test.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions tests/dogfood.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions tests/fmt.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 2 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions tests/lint_message_convention.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 2 additions & 0 deletions tests/missing-test-files.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
3 changes: 3 additions & 0 deletions tests/versioncheck.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 5d3fc6f

Please sign in to comment.