diff --git a/CHANGELOG.md b/CHANGELOG.md index 989f9f2da787..d000f2dd9994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log All notable changes to this project will be documented in this file. +## 0.0.162 +* Update to *rustc 1.22.0-nightly (0701b37d9 2017-09-18)* +* New lint: [`chars_last_cmp`] +* Improved suggestions for [`needless_borrow`], [`ptr_arg`], + ## 0.0.161 * Update to *rustc 1.22.0-nightly (539f2083d 2017-09-13)* @@ -457,6 +462,7 @@ All notable changes to this project will be documented in this file. [`cast_precision_loss`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#cast_precision_loss [`cast_sign_loss`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#cast_sign_loss [`char_lit_as_u8`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#char_lit_as_u8 +[`chars_last_cmp`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#chars_last_cmp [`chars_next_cmp`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#chars_next_cmp [`clone_double_ref`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#clone_double_ref [`clone_on_copy`]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#clone_on_copy diff --git a/Cargo.lock b/Cargo.lock index ffc84a488eb9..88f1a8a7f3ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ [root] name = "clippy_lints" -version = "0.0.161" +version = "0.0.162" dependencies = [ "itertools 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -73,11 +73,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clippy" -version = "0.0.161" +version = "0.0.162" dependencies = [ "cargo_metadata 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "clippy-mini-macro-test 0.1.0", - "clippy_lints 0.0.161", + "clippy_lints 0.0.162", "compiletest_rs 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "duct 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 41ea684f327f..46780712ad94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clippy" -version = "0.0.161" +version = "0.0.162" authors = [ "Manish Goregaokar ", "Andre Bogus ", @@ -31,7 +31,7 @@ path = "src/main.rs" [dependencies] # begin automatic update -clippy_lints = { version = "0.0.161", path = "clippy_lints" } +clippy_lints = { version = "0.0.162", path = "clippy_lints" } # end automatic update cargo_metadata = "0.2" diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index fee0391dacd6..ef527dbf0399 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.161" +version = "0.0.162" # end automatic update authors = [ "Manish Goregaokar ", diff --git a/clippy_lints/src/bit_mask.rs b/clippy_lints/src/bit_mask.rs index db57864cb2f0..9b64a42d4f7f 100644 --- a/clippy_lints/src/bit_mask.rs +++ b/clippy_lints/src/bit_mask.rs @@ -307,7 +307,7 @@ fn fetch_int_literal(cx: &LateContext, lit: &Expr) -> Option { cx.tcx.mir_const_qualif(def_id); cx.tcx.hir.body(cx.tcx.hir.body_owned_by(id)) } else { - cx.tcx.extern_const_body(def_id) + cx.tcx.extern_const_body(def_id).body }; fetch_int_literal(cx, &body.value) }) diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index 2611ba1adf2d..7e6f3c2acf11 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -298,7 +298,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { self.tcx.mir_const_qualif(def_id); self.tcx.hir.body(self.tcx.hir.body_owned_by(id)) } else { - self.tcx.extern_const_body(def_id) + self.tcx.extern_const_body(def_id).body }; let ret = cx.expr(&body.value); if ret.is_some() { diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 520f9362c0fd..5cb7034c7bfc 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -458,6 +458,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) { matches::MATCH_REF_PATS, matches::MATCH_WILD_ERR_ARM, matches::SINGLE_MATCH, + methods::CHARS_LAST_CMP, methods::CHARS_NEXT_CMP, methods::CLONE_DOUBLE_REF, methods::CLONE_ON_COPY,