mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-18 06:58:42 +00:00
Rustup
This commit is contained in:
parent
6f9b3ca346
commit
fc008aa14c
10 changed files with 21 additions and 17 deletions
|
@ -1,6 +1,10 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
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
|
## 0.0.204
|
||||||
* Rustup to *rustc 1.28.0-nightly (71e87be38 2018-05-22)*
|
* Rustup to *rustc 1.28.0-nightly (71e87be38 2018-05-22)*
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "clippy"
|
name = "clippy"
|
||||||
version = "0.0.204"
|
version = "0.0.205"
|
||||||
authors = [
|
authors = [
|
||||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||||
"Andre Bogus <bogusandre@gmail.com>",
|
"Andre Bogus <bogusandre@gmail.com>",
|
||||||
|
@ -37,7 +37,7 @@ path = "src/driver.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# begin automatic update
|
# begin automatic update
|
||||||
clippy_lints = { version = "0.0.204", path = "clippy_lints" }
|
clippy_lints = { version = "0.0.205", path = "clippy_lints" }
|
||||||
# end automatic update
|
# end automatic update
|
||||||
regex = "1"
|
regex = "1"
|
||||||
semver = "0.9"
|
semver = "0.9"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "clippy_lints"
|
name = "clippy_lints"
|
||||||
# begin automatic update
|
# begin automatic update
|
||||||
version = "0.0.204"
|
version = "0.0.205"
|
||||||
# end automatic update
|
# end automatic update
|
||||||
authors = [
|
authors = [
|
||||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||||
|
|
|
@ -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<Constant> {
|
pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<'tcx>) -> Option<Constant> {
|
||||||
use rustc::mir::interpret::{PrimVal, ConstValue};
|
use rustc::mir::interpret::{Scalar, ConstValue};
|
||||||
match result.val {
|
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::TyBool => Some(Constant::Bool(b == 1)),
|
||||||
ty::TyUint(_) | ty::TyInt(_) => Some(Constant::Int(b)),
|
ty::TyUint(_) | ty::TyInt(_) => Some(Constant::Int(b)),
|
||||||
ty::TyFloat(FloatTy::F32) => Some(Constant::F32(f32::from_bits(b as u32))),
|
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
|
// FIXME: implement other conversion
|
||||||
_ => None,
|
_ => 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::TyRef(_, tam, _) => match tam.sty {
|
||||||
ty::TyStr => {
|
ty::TyStr => {
|
||||||
let alloc = tcx
|
let alloc = tcx
|
||||||
|
|
|
@ -543,7 +543,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
|
||||||
len_zero::LEN_ZERO,
|
len_zero::LEN_ZERO,
|
||||||
let_if_seq::USELESS_LET_IF_SEQ,
|
let_if_seq::USELESS_LET_IF_SEQ,
|
||||||
lifetimes::NEEDLESS_LIFETIMES,
|
lifetimes::NEEDLESS_LIFETIMES,
|
||||||
lifetimes::UNUSED_LIFETIMES,
|
lifetimes::EXTRA_UNUSED_LIFETIMES,
|
||||||
literal_representation::INCONSISTENT_DIGIT_GROUPING,
|
literal_representation::INCONSISTENT_DIGIT_GROUPING,
|
||||||
literal_representation::LARGE_DIGIT_GROUPS,
|
literal_representation::LARGE_DIGIT_GROUPS,
|
||||||
literal_representation::UNREADABLE_LITERAL,
|
literal_representation::UNREADABLE_LITERAL,
|
||||||
|
@ -786,7 +786,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
|
||||||
identity_op::IDENTITY_OP,
|
identity_op::IDENTITY_OP,
|
||||||
int_plus_one::INT_PLUS_ONE,
|
int_plus_one::INT_PLUS_ONE,
|
||||||
lifetimes::NEEDLESS_LIFETIMES,
|
lifetimes::NEEDLESS_LIFETIMES,
|
||||||
lifetimes::UNUSED_LIFETIMES,
|
lifetimes::EXTRA_UNUSED_LIFETIMES,
|
||||||
loops::EXPLICIT_COUNTER_LOOP,
|
loops::EXPLICIT_COUNTER_LOOP,
|
||||||
loops::MUT_RANGE_BOUND,
|
loops::MUT_RANGE_BOUND,
|
||||||
loops::WHILE_LET_LOOP,
|
loops::WHILE_LET_LOOP,
|
||||||
|
|
|
@ -43,7 +43,7 @@ declare_clippy_lint! {
|
||||||
/// fn unused_lifetime<'a>(x: u8) { .. }
|
/// fn unused_lifetime<'a>(x: u8) { .. }
|
||||||
/// ```
|
/// ```
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
pub UNUSED_LIFETIMES,
|
pub EXTRA_UNUSED_LIFETIMES,
|
||||||
complexity,
|
complexity,
|
||||||
"unused lifetimes in function definitions"
|
"unused lifetimes in function definitions"
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ pub struct LifetimePass;
|
||||||
|
|
||||||
impl LintPass for LifetimePass {
|
impl LintPass for LifetimePass {
|
||||||
fn get_lints(&self) -> LintArray {
|
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);
|
walk_fn_decl(&mut checker, func);
|
||||||
|
|
||||||
for &v in checker.map.values() {
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
rustc 1.28.0-nightly (71e87be38 2018-05-22)
|
rustc 1.28.0-nightly (990d8aa74 2018-05-25)
|
||||||
binary: rustc
|
binary: rustc
|
||||||
commit-hash: 71e87be381bd6020645d925c579fa7367167d3d8
|
commit-hash: 990d8aa743b1dda3cc0f68fe09524486261812c6
|
||||||
commit-date: 2018-05-22
|
commit-date: 2018-05-25
|
||||||
host: x86_64-unknown-linux-gnu
|
host: x86_64-unknown-linux-gnu
|
||||||
release: 1.28.0-nightly
|
release: 1.28.0-nightly
|
||||||
LLVM version: 6.0
|
LLVM version: 6.0
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#![warn(needless_lifetimes, unused_lifetimes)]
|
#![warn(needless_lifetimes, extra_unused_lifetimes)]
|
||||||
#![allow(dead_code, needless_pass_by_value)]
|
#![allow(dead_code, needless_pass_by_value)]
|
||||||
|
|
||||||
fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
|
fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
#![allow(unused, dead_code, needless_lifetimes, needless_pass_by_value)]
|
#![allow(unused, dead_code, needless_lifetimes, needless_pass_by_value)]
|
||||||
#![warn(unused_lifetimes)]
|
#![warn(extra_unused_lifetimes)]
|
||||||
|
|
||||||
fn empty() {
|
fn empty() {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: this lifetime isn't used in the function definition
|
||||||
16 | fn unused_lt<'a>(x: u8) {
|
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
|
error: this lifetime isn't used in the function definition
|
||||||
--> $DIR/unused_lt.rs:20:25
|
--> $DIR/unused_lt.rs:20:25
|
||||||
|
|
Loading…
Add table
Reference in a new issue