Update clippy settings and fix a few clippy warnings.

This commit is contained in:
Dan Gohman
2019-01-07 11:21:28 -08:00
parent a7aee246e9
commit 9eba81a8d9
40 changed files with 246 additions and 233 deletions

View File

@@ -11,10 +11,7 @@
)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(
feature = "cargo-clippy",
allow(new_without_default, new_without_default_derive)
)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))]
#![cfg_attr(
feature = "cargo-clippy",
warn(

View File

@@ -51,7 +51,8 @@ pub fn parse_test<'a>(
let isa_spec: isaspec::IsaSpec;
let commands: Vec<TestCommand<'a>>;
// Check for specified passes and target, if present throw out test commands/targets specified in file.
// Check for specified passes and target, if present throw out test commands/targets specified
// in file.
match passes {
Some(pass_vec) => {
parser.parse_test_commands();
@@ -338,7 +339,7 @@ impl<'a> Parser<'a> {
// clippy says self.lookahead is immutable so this loop is either infinite or never
// running. I don't think this is true - self.lookahead is mutated in the loop body - so
// maybe this is a clippy bug? Either way, disable clippy for this.
#[cfg_attr(feature = "cargo-clippy", allow(while_immutable_condition))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::while_immutable_condition))]
while self.lookahead == None {
match self.lex.next() {
Some(Ok(LocatedToken { token, location })) => {