diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e233837be4..ff95dc72b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to this project will be documented in this file. +## 0.0.205 +* Rustup to *rustc 1.28.0-nightly (990d8aa74 2018-05-25)* +* Rename `unused_lifetimes` to `extra_unused_lifetimes` because of naming conflict with new rustc lint + ## 0.0.204 * Rustup to *rustc 1.28.0-nightly (71e87be38 2018-05-22)* diff --git a/Cargo.toml b/Cargo.toml index 67631ebcc17..9d49b89440e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clippy" -version = "0.0.204" +version = "0.0.205" authors = [ "Manish Goregaokar ", "Andre Bogus ", @@ -37,7 +37,7 @@ path = "src/driver.rs" [dependencies] # begin automatic update -clippy_lints = { version = "0.0.204", path = "clippy_lints" } +clippy_lints = { version = "0.0.205", path = "clippy_lints" } # end automatic update regex = "1" semver = "0.9" diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index 813efd9ba5c..a02cad5b181 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.204" +version = "0.0.205" # end automatic update authors = [ "Manish Goregaokar ", diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index 3e803c11b1a..d02836441e1 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -415,9 +415,9 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { } pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<'tcx>) -> Option { - use rustc::mir::interpret::{PrimVal, ConstValue}; + use rustc::mir::interpret::{Scalar, ConstValue}; match result.val { - ConstVal::Value(ConstValue::ByVal(PrimVal::Bytes(b))) => match result.ty.sty { + ConstVal::Value(ConstValue::Scalar(Scalar::Bits{ bits: b, ..})) => match result.ty.sty { ty::TyBool => Some(Constant::Bool(b == 1)), ty::TyUint(_) | ty::TyInt(_) => Some(Constant::Int(b)), ty::TyFloat(FloatTy::F32) => Some(Constant::F32(f32::from_bits(b as u32))), @@ -425,7 +425,7 @@ pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<' // FIXME: implement other conversion _ => None, }, - ConstVal::Value(ConstValue::ByValPair(PrimVal::Ptr(ptr), PrimVal::Bytes(n))) => match result.ty.sty { + ConstVal::Value(ConstValue::ScalarPair(Scalar::Ptr(ptr), Scalar::Bits { bits: n, .. })) => match result.ty.sty { ty::TyRef(_, tam, _) => match tam.sty { ty::TyStr => { let alloc = tcx diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index aaf2ef5738c..efba3b69577 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -543,7 +543,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) { len_zero::LEN_ZERO, let_if_seq::USELESS_LET_IF_SEQ, lifetimes::NEEDLESS_LIFETIMES, - lifetimes::UNUSED_LIFETIMES, + lifetimes::EXTRA_UNUSED_LIFETIMES, literal_representation::INCONSISTENT_DIGIT_GROUPING, literal_representation::LARGE_DIGIT_GROUPS, literal_representation::UNREADABLE_LITERAL, @@ -786,7 +786,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) { identity_op::IDENTITY_OP, int_plus_one::INT_PLUS_ONE, lifetimes::NEEDLESS_LIFETIMES, - lifetimes::UNUSED_LIFETIMES, + lifetimes::EXTRA_UNUSED_LIFETIMES, loops::EXPLICIT_COUNTER_LOOP, loops::MUT_RANGE_BOUND, loops::WHILE_LET_LOOP, diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index 01177c36be9..3804823ae5a 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -43,7 +43,7 @@ declare_clippy_lint! { /// fn unused_lifetime<'a>(x: u8) { .. } /// ``` declare_clippy_lint! { - pub UNUSED_LIFETIMES, + pub EXTRA_UNUSED_LIFETIMES, complexity, "unused lifetimes in function definitions" } @@ -53,7 +53,7 @@ pub struct LifetimePass; impl LintPass for LifetimePass { fn get_lints(&self) -> LintArray { - lint_array!(NEEDLESS_LIFETIMES, UNUSED_LIFETIMES) + lint_array!(NEEDLESS_LIFETIMES, EXTRA_UNUSED_LIFETIMES) } } @@ -431,7 +431,7 @@ fn report_extra_lifetimes<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, func: &'tcx walk_fn_decl(&mut checker, func); for &v in checker.map.values() { - span_lint(cx, UNUSED_LIFETIMES, v, "this lifetime isn't used in the function definition"); + span_lint(cx, EXTRA_UNUSED_LIFETIMES, v, "this lifetime isn't used in the function definition"); } } diff --git a/min_version.txt b/min_version.txt index 0c27e9607eb..55f113ccd9d 100644 --- a/min_version.txt +++ b/min_version.txt @@ -1,7 +1,7 @@ -rustc 1.28.0-nightly (71e87be38 2018-05-22) +rustc 1.28.0-nightly (990d8aa74 2018-05-25) binary: rustc -commit-hash: 71e87be381bd6020645d925c579fa7367167d3d8 -commit-date: 2018-05-22 +commit-hash: 990d8aa743b1dda3cc0f68fe09524486261812c6 +commit-date: 2018-05-25 host: x86_64-unknown-linux-gnu release: 1.28.0-nightly LLVM version: 6.0 diff --git a/tests/ui/lifetimes.rs b/tests/ui/lifetimes.rs index dce9c23da68..1f6aeaafcf1 100644 --- a/tests/ui/lifetimes.rs +++ b/tests/ui/lifetimes.rs @@ -1,7 +1,7 @@ -#![warn(needless_lifetimes, unused_lifetimes)] +#![warn(needless_lifetimes, extra_unused_lifetimes)] #![allow(dead_code, needless_pass_by_value)] fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { } diff --git a/tests/ui/unused_lt.rs b/tests/ui/unused_lt.rs index 91bca47eb12..198730d87f3 100644 --- a/tests/ui/unused_lt.rs +++ b/tests/ui/unused_lt.rs @@ -1,7 +1,7 @@ #![allow(unused, dead_code, needless_lifetimes, needless_pass_by_value)] -#![warn(unused_lifetimes)] +#![warn(extra_unused_lifetimes)] fn empty() { diff --git a/tests/ui/unused_lt.stderr b/tests/ui/unused_lt.stderr index b1fcebe6eed..f01dfda7013 100644 --- a/tests/ui/unused_lt.stderr +++ b/tests/ui/unused_lt.stderr @@ -4,7 +4,7 @@ error: this lifetime isn't used in the function definition 16 | fn unused_lt<'a>(x: u8) { | ^^ | - = note: `-D unused-lifetimes` implied by `-D warnings` + = note: `-D extra-unused-lifetimes` implied by `-D warnings` error: this lifetime isn't used in the function definition --> $DIR/unused_lt.rs:20:25