Formatting
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
|
use crate::utils::span_lint;
|
||||||
use rustc::hir::*;
|
use rustc::hir::*;
|
||||||
use rustc::lint::*;
|
use rustc::lint::*;
|
||||||
use std::f64::consts as f64;
|
use std::f64::consts as f64;
|
||||||
use syntax::ast::{FloatTy, Lit, LitKind};
|
use syntax::ast::{FloatTy, Lit, LitKind};
|
||||||
use syntax::symbol;
|
use syntax::symbol;
|
||||||
use crate::utils::span_lint;
|
|
||||||
|
|
||||||
/// **What it does:** Checks for floating point literals that approximate
|
/// **What it does:** Checks for floating point literals that approximate
|
||||||
/// constants which are defined in
|
/// constants which are defined in
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
use crate::utils::span_lint;
|
||||||
use rustc::hir;
|
use rustc::hir;
|
||||||
use rustc::lint::*;
|
use rustc::lint::*;
|
||||||
use syntax::codemap::Span;
|
use syntax::codemap::Span;
|
||||||
use crate::utils::span_lint;
|
|
||||||
|
|
||||||
/// **What it does:** Checks for plain integer arithmetic.
|
/// **What it does:** Checks for plain integer arithmetic.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use crate::consts::{constant, Constant};
|
use crate::consts::{constant, Constant};
|
||||||
|
use crate::utils::higher::Range;
|
||||||
|
use crate::utils::{self, higher};
|
||||||
use rustc::hir;
|
use rustc::hir;
|
||||||
use rustc::lint::*;
|
use rustc::lint::*;
|
||||||
use rustc::ty;
|
use rustc::ty;
|
||||||
use syntax::ast::RangeLimits;
|
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
|
/// **What it does:** Checks for out of bounds array indexing with a constant
|
||||||
/// index.
|
/// index.
|
||||||
|
|||||||
@@ -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;
|
||||||
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
|
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
|
||||||
use rustc::lint::*;
|
use rustc::lint::*;
|
||||||
use syntax::ast;
|
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
|
/// **What it does:** Checks for compound assignment operations (`+=` and
|
||||||
/// similar).
|
/// similar).
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
extern crate compiletest_rs as compiletest;
|
extern crate compiletest_rs as compiletest;
|
||||||
extern crate test;
|
extern crate test;
|
||||||
|
|
||||||
use std::io;
|
use std::env::{set_var, var};
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::env::{set_var, var};
|
use std::io;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
fn clippy_driver_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(),
|
relative_dir: dir_path.file_name().unwrap().into(),
|
||||||
};
|
};
|
||||||
let test_name = compiletest::make_test_name(&config, &paths);
|
let test_name = compiletest::make_test_name(&config, &paths);
|
||||||
let index = tests.iter()
|
let index = tests
|
||||||
|
.iter()
|
||||||
.position(|test| test.desc.name == test_name)
|
.position(|test| test.desc.name == test_name)
|
||||||
.expect("The test should be in there");
|
.expect("The test should be in there");
|
||||||
result &= test::run_tests_console(
|
result &= test::run_tests_console(&opts, vec![tests.swap_remove(index)])?;
|
||||||
&opts,
|
|
||||||
vec![tests.swap_remove(index)])?;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(result)
|
Ok(result)
|
||||||
@@ -111,11 +110,11 @@ fn run_ui_toml() {
|
|||||||
|
|
||||||
let res = run_ui_toml_tests(&config, tests);
|
let res = run_ui_toml_tests(&config, tests);
|
||||||
match res {
|
match res {
|
||||||
Ok(true) => {}
|
Ok(true) => {},
|
||||||
Ok(false) => panic!("Some tests failed"),
|
Ok(false) => panic!("Some tests failed"),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("I/O failure during tests: {:?}", e);
|
println!("I/O failure during tests: {:?}", e);
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user