Formatting

This commit is contained in:
Mateusz Mikuła 2018-06-07 19:16:50 +02:00
parent 52deb3b086
commit 3693a4ea53
5 changed files with 13 additions and 14 deletions

View File

@ -1,9 +1,9 @@
use crate::utils::span_lint;
use rustc::hir::*;
use rustc::lint::*;
use std::f64::consts as f64;
use syntax::ast::{FloatTy, Lit, LitKind};
use syntax::symbol;
use crate::utils::span_lint;
/// **What it does:** Checks for floating point literals that approximate
/// constants which are defined in

View File

@ -1,7 +1,7 @@
use crate::utils::span_lint;
use rustc::hir;
use rustc::lint::*;
use syntax::codemap::Span;
use crate::utils::span_lint;
/// **What it does:** Checks for plain integer arithmetic.
///

View File

@ -1,10 +1,10 @@
use crate::consts::{constant, Constant};
use crate::utils::higher::Range;
use crate::utils::{self, higher};
use rustc::hir;
use rustc::lint::*;
use rustc::ty;
use syntax::ast::RangeLimits;
use crate::utils::higher::Range;
use crate::utils::{self, higher};
/// **What it does:** Checks for out of bounds array indexing with a constant
/// index.

View File

@ -1,9 +1,9 @@
use crate::utils::{get_trait_def_id, implements_trait, snippet_opt, span_lint_and_then, SpanlessEq};
use crate::utils::{higher, sugg};
use rustc::hir;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::lint::*;
use syntax::ast;
use crate::utils::{get_trait_def_id, implements_trait, snippet_opt, span_lint_and_then, SpanlessEq};
use crate::utils::{higher, sugg};
/// **What it does:** Checks for compound assignment operations (`+=` and
/// similar).

View File

@ -3,10 +3,10 @@
extern crate compiletest_rs as compiletest;
extern crate test;
use std::io;
use std::env::{set_var, var};
use std::ffi::OsStr;
use std::fs;
use std::env::{set_var, var};
use std::io;
use std::path::{Path, PathBuf};
fn clippy_driver_path() -> PathBuf {
@ -93,12 +93,11 @@ fn run_ui_toml_tests(config: &compiletest::Config, mut tests: Vec<test::TestDesc
relative_dir: dir_path.file_name().unwrap().into(),
};
let test_name = compiletest::make_test_name(&config, &paths);
let index = tests.iter()
let index = tests
.iter()
.position(|test| test.desc.name == test_name)
.expect("The test should be in there");
result &= test::run_tests_console(
&opts,
vec![tests.swap_remove(index)])?;
result &= test::run_tests_console(&opts, vec![tests.swap_remove(index)])?;
}
}
Ok(result)
@ -111,11 +110,11 @@ fn run_ui_toml() {
let res = run_ui_toml_tests(&config, tests);
match res {
Ok(true) => {}
Ok(true) => {},
Ok(false) => panic!("Some tests failed"),
Err(e) => {
println!("I/O failure during tests: {:?}", e);
}
},
}
}