From 301ef6bb2a3883da9b1340b243f3a934ec3c6fb8 Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Tue, 17 Sep 2019 00:50:15 +0900 Subject: Fix false-positive of redundant_clone and move to clippy::perf --- clippy_lints/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clippy_lints/src/lib.rs') diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 10a14f3b906..3e31779426a 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -864,6 +864,7 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con ranges::RANGE_MINUS_ONE, ranges::RANGE_PLUS_ONE, ranges::RANGE_ZIP_WITH_LEN, + redundant_clone::REDUNDANT_CLONE, redundant_field_names::REDUNDANT_FIELD_NAMES, redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING, redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES, @@ -1169,6 +1170,7 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con methods::SINGLE_CHAR_PATTERN, misc::CMP_OWNED, mutex_atomic::MUTEX_ATOMIC, + redundant_clone::REDUNDANT_CLONE, slow_vector_initialization::SLOW_VECTOR_INITIALIZATION, trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF, types::BOX_VEC, @@ -1188,7 +1190,6 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con mutex_atomic::MUTEX_INTEGER, needless_borrow::NEEDLESS_BORROW, path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE, - redundant_clone::REDUNDANT_CLONE, ]); } -- cgit 1.4.1-3-g733a5 From 4cded6d9012bbfc77d13c7ef2a413402199a2a03 Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Wed, 2 Oct 2019 08:02:18 +0900 Subject: extern rustc_index --- clippy_lints/src/lib.rs | 2 ++ clippy_lints/src/redundant_clone.rs | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'clippy_lints/src/lib.rs') diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 3e31779426a..490f47424b1 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -27,6 +27,8 @@ extern crate rustc_driver; #[allow(unused_extern_crates)] extern crate rustc_errors; #[allow(unused_extern_crates)] +extern crate rustc_index; +#[allow(unused_extern_crates)] extern crate rustc_mir; #[allow(unused_extern_crates)] extern crate rustc_target; diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs index c0f6f3ae76d..478ca2e04ff 100644 --- a/clippy_lints/src/redundant_clone.rs +++ b/clippy_lints/src/redundant_clone.rs @@ -13,12 +13,9 @@ use rustc::mir::{ }; use rustc::ty::{self, fold::TypeVisitor, Ty}; use rustc::{declare_lint_pass, declare_tool_lint}; -use rustc_data_structures::{ - bit_set::{BitSet, HybridBitSet}, - fx::FxHashMap, - transitive_relation::TransitiveRelation, -}; +use rustc_data_structures::{fx::FxHashMap, transitive_relation::TransitiveRelation}; use rustc_errors::Applicability; +use rustc_index::bit_set::{BitSet, HybridBitSet}; use rustc_mir::dataflow::{ do_dataflow, BitDenotation, BottomValue, DataflowResults, DataflowResultsCursor, DebugFormatted, GenKillSet, }; -- cgit 1.4.1-3-g733a5