mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-26 06:30:32 +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
|
||||
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)*
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "clippy"
|
||||
version = "0.0.204"
|
||||
version = "0.0.205"
|
||||
authors = [
|
||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||
"Andre Bogus <bogusandre@gmail.com>",
|
||||
|
@ -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"
|
||||
|
|
|
@ -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 <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> {
|
||||
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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) { }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
#![allow(unused, dead_code, needless_lifetimes, needless_pass_by_value)]
|
||||
#![warn(unused_lifetimes)]
|
||||
#![warn(extra_unused_lifetimes)]
|
||||
|
||||
fn empty() {
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue