diff --git a/CHANGELOG.md b/CHANGELOG.md index 6093bc0b5b0..90ea18f5f6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. +## 0.0.176 +* Rustup to *rustc 1.24.0-nightly (0077d128d 2017-12-14)* + ## 0.0.175 * Rustup to *rustc 1.24.0-nightly (bb42071f6 2017-12-01)* diff --git a/Cargo.toml b/Cargo.toml index 5101ae05d32..75e57b6889a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clippy" -version = "0.0.175" +version = "0.0.176" authors = [ "Manish Goregaokar ", "Andre Bogus ", @@ -37,7 +37,7 @@ path = "src/driver.rs" [dependencies] # begin automatic update -clippy_lints = { version = "0.0.175", path = "clippy_lints" } +clippy_lints = { version = "0.0.176", path = "clippy_lints" } # end automatic update cargo_metadata = "0.2" regex = "0.2" @@ -45,7 +45,7 @@ regex = "0.2" [dev-dependencies] compiletest_rs = "0.3" duct = "0.8.2" -lazy_static = "0.2" +lazy_static = "1.0" serde_derive = "1.0" clippy-mini-macro-test = { version = "0.1", path = "mini-macro" } serde = "1.0" diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index cbf40240a7f..00416d24d64 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clippy_lints" # begin automatic update -version = "0.0.175" +version = "0.0.176" # end automatic update authors = [ "Manish Goregaokar ", @@ -17,7 +17,7 @@ keywords = ["clippy", "lint", "plugin"] [dependencies] itertools = "0.6.0" -lazy_static = "0.2.8" +lazy_static = "1.0" matches = "0.1.2" quine-mc_cluskey = "0.2.2" regex-syntax = "0.4.0" diff --git a/clippy_lints/src/missing_doc.rs b/clippy_lints/src/missing_doc.rs index 768e6cc3ec6..2a3a4e365a5 100644 --- a/clippy_lints/src/missing_doc.rs +++ b/clippy_lints/src/missing_doc.rs @@ -129,6 +129,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { hir::ItemStatic(..) => "a static", hir::ItemStruct(..) => "a struct", hir::ItemTrait(..) => "a trait", + hir::ItemTraitAlias(..) => "a trait alias", hir::ItemGlobalAsm(..) => "an assembly blob", hir::ItemTy(..) => "a type alias", hir::ItemUnion(..) => "a union", diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs index ae1d9462b7c..fa6681ef078 100644 --- a/clippy_lints/src/utils/inspector.rs +++ b/clippy_lints/src/utils/inspector.rs @@ -403,6 +403,9 @@ fn print_item(cx: &LateContext, item: &hir::Item) { println!("trait is not auto"); } }, + hir::ItemTraitAlias(..) => { + println!("trait alias"); + } hir::ItemAutoImpl(_, ref _trait_ref) => { println!("auto impl"); }, diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 77c70922dba..0c1b10f05c8 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -940,6 +940,7 @@ pub fn opt_def_id(def: Def) -> Option { Def::StructCtor(id, ..) | Def::Union(id) | Def::Trait(id) | + Def::TraitAlias(id) | Def::Method(id) | Def::Const(id) | Def::AssociatedConst(id) | diff --git a/src/main.rs b/src/main.rs index c613f029b16..8affe549348 100644 --- a/src/main.rs +++ b/src/main.rs @@ -141,10 +141,12 @@ pub fn main() { let args = std::iter::once(format!("--manifest-path={}", manifest_path)).chain(args); if let Some(first) = target.kind.get(0) { if target.kind.len() > 1 || first.ends_with("lib") { + println!("lib: {}", target.name); if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args)) { std::process::exit(code); } } else if ["bin", "example", "test", "bench"].contains(&&**first) { + println!("{}: {}", first, target.name); if let Err(code) = process( vec![format!("--{}", first), target.name] .into_iter() diff --git a/tests/compile-test.rs b/tests/compile-test.rs index 51ab6aee3a4..d532d4e5a59 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -72,21 +72,3 @@ fn compile_test() { run_mode("run-pass", "run-pass"); run_mode("ui", "ui"); } - -#[test] -fn dogfood() { - prepare_env(); - let files = ["src/main.rs", "src/driver.rs", "src/lib.rs", "clippy_lints/src/lib.rs"]; - let mut config = config("dogfood", "ui"); - config.target_rustcflags = config.target_rustcflags.map(|flags| format!("{} -Dclippy -Dclippy_pedantic -Dclippy_internal", flags)); - - for file in &files { - let paths = test::TestPaths { - base: PathBuf::new(), - file: PathBuf::from(file), - relative_dir: PathBuf::new(), - }; - - compiletest::runtest::run(config.clone(), &paths); - } -} diff --git a/tests/dogfood.rs b/tests/dogfood.rs new file mode 100644 index 00000000000..1514383e6de --- /dev/null +++ b/tests/dogfood.rs @@ -0,0 +1,17 @@ +#[test] +fn dogfood() { + let root_dir = std::env::current_dir().unwrap(); + for d in &[".", "clippy_lints"] { + std::env::set_current_dir(root_dir.join(d)).unwrap(); + let output = std::process::Command::new("cargo") + .arg("run") + .arg("--bin").arg("cargo-clippy") + .arg("--manifest-path").arg(root_dir.join("Cargo.toml")) + .output().unwrap(); + println!("status: {}", output.status); + println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + + assert!(output.status.success()); + } +} diff --git a/tests/run-pass/mut_mut_macro.rs b/tests/mut_mut_macro.rs similarity index 100% rename from tests/run-pass/mut_mut_macro.rs rename to tests/mut_mut_macro.rs