Skip to content

Commit 249b6ca

Browse files
committed
Auto merge of #4625 - phansch:rollup-qp7ki0h, r=phansch
Rollup of 2 pull requests Successful merges: - #4509 (Fix false-positive of redundant_clone and move to clippy::perf) - #4614 (Allow casts from the result of `abs` to unsigned) Failed merges: changelog: none r? @ghost
2 parents c926f1b + 19c58d2 commit 249b6ca

23 files changed

+733
-205
lines changed

clippy_dev/src/fmt.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ pub fn run(check: bool, verbose: bool) {
100100
}
101101

102102
fn format_command(program: impl AsRef<OsStr>, dir: impl AsRef<Path>, args: &[impl AsRef<OsStr>]) -> String {
103-
let arg_display: Vec<_> = args
104-
.iter()
105-
.map(|a| escape(a.as_ref().to_string_lossy()).to_owned())
106-
.collect();
103+
let arg_display: Vec<_> = args.iter().map(|a| escape(a.as_ref().to_string_lossy())).collect();
107104

108105
format!(
109106
"cd {} && {} {}",

clippy_lints/src/booleans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
343343

344344
let stats = terminal_stats(&expr);
345345
let mut simplified = expr.simplify();
346-
for simple in Bool::Not(Box::new(expr.clone())).simplify() {
346+
for simple in Bool::Not(Box::new(expr)).simplify() {
347347
match simple {
348348
Bool::Not(_) | Bool::True | Bool::False => {},
349349
_ => simplified.push(Bool::Not(Box::new(simple.clone()))),

clippy_lints/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ extern crate rustc_driver;
2727
#[allow(unused_extern_crates)]
2828
extern crate rustc_errors;
2929
#[allow(unused_extern_crates)]
30+
extern crate rustc_index;
31+
#[allow(unused_extern_crates)]
3032
extern crate rustc_mir;
3133
#[allow(unused_extern_crates)]
3234
extern crate rustc_target;
@@ -864,6 +866,7 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con
864866
ranges::RANGE_MINUS_ONE,
865867
ranges::RANGE_PLUS_ONE,
866868
ranges::RANGE_ZIP_WITH_LEN,
869+
redundant_clone::REDUNDANT_CLONE,
867870
redundant_field_names::REDUNDANT_FIELD_NAMES,
868871
redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING,
869872
redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES,
@@ -1169,6 +1172,7 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con
11691172
methods::SINGLE_CHAR_PATTERN,
11701173
misc::CMP_OWNED,
11711174
mutex_atomic::MUTEX_ATOMIC,
1175+
redundant_clone::REDUNDANT_CLONE,
11721176
slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
11731177
trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
11741178
types::BOX_VEC,
@@ -1188,7 +1192,6 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con
11881192
mutex_atomic::MUTEX_INTEGER,
11891193
needless_borrow::NEEDLESS_BORROW,
11901194
path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
1191-
redundant_clone::REDUNDANT_CLONE,
11921195
]);
11931196
}
11941197

0 commit comments

Comments
 (0)