Skip to content

Commit fcac868

Browse files
committed
Auto merge of #111848 - Dylan-DPC:rollup-7jqydzg, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #111501 (MIR drive-by cleanups) - #111609 (Mark internal functions and traits unsafe to reflect preconditions) - #111612 (Give better error when collecting into `&[T]`) - #111756 (Rename `{drop,forget}_{copy,ref}` lints to more consistent naming) - #111843 (move lcnr to only review types stuff) - #111844 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4781147 + e6e2c30 commit fcac868

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

clippy_lints/src/drop_forget_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetRef {
9898
let is_copy = is_copy(cx, arg_ty);
9999
let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
100100
let (lint, msg) = match fn_name {
101-
// early return for uplifted lints: drop_ref, drop_copy, forget_ref, forget_copy
101+
// early return for uplifted lints: dropping_references, dropping_copy_types, forgetting_references, forgetting_copy_types
102102
sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => return,
103103
sym::mem_forget if arg_ty.is_ref() => return,
104104
sym::mem_drop if is_copy && !drop_is_single_call_in_arm => return,

clippy_lints/src/renamed_lints.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
3333
("clippy::zero_width_space", "clippy::invisible_characters"),
3434
("clippy::clone_double_ref", "suspicious_double_ref_op"),
3535
("clippy::drop_bounds", "drop_bounds"),
36-
("clippy::drop_copy", "drop_copy"),
37-
("clippy::drop_ref", "drop_ref"),
36+
("clippy::drop_copy", "dropping_copy_types"),
37+
("clippy::drop_ref", "dropping_references"),
3838
("clippy::for_loop_over_option", "for_loops_over_fallibles"),
3939
("clippy::for_loop_over_result", "for_loops_over_fallibles"),
4040
("clippy::for_loops_over_fallibles", "for_loops_over_fallibles"),
41-
("clippy::forget_copy", "forget_copy"),
42-
("clippy::forget_ref", "forget_ref"),
41+
("clippy::forget_copy", "forgetting_copy_types"),
42+
("clippy::forget_ref", "forgetting_references"),
4343
("clippy::into_iter_on_array", "array_into_iter"),
4444
("clippy::invalid_atomic_ordering", "invalid_atomic_ordering"),
4545
("clippy::invalid_ref", "invalid_value"),

tests/ui/mem_forget.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::mem as memstuff;
55
use std::mem::forget as forgetSomething;
66

77
#[warn(clippy::mem_forget)]
8-
#[allow(forget_copy)]
8+
#[allow(forgetting_copy_types)]
99
fn main() {
1010
let five: i32 = 5;
1111
forgetSomething(five);

tests/ui/multiple_unsafe_ops_per_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(unused)]
33
#![allow(deref_nullptr)]
44
#![allow(clippy::unnecessary_operation)]
5-
#![allow(drop_copy)]
5+
#![allow(dropping_copy_types)]
66
#![warn(clippy::multiple_unsafe_ops_per_block)]
77

88
extern crate proc_macros;

tests/ui/rename.fixed

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
#![allow(clippy::invisible_characters)]
3131
#![allow(suspicious_double_ref_op)]
3232
#![allow(drop_bounds)]
33-
#![allow(drop_copy)]
34-
#![allow(drop_ref)]
33+
#![allow(dropping_copy_types)]
34+
#![allow(dropping_references)]
3535
#![allow(for_loops_over_fallibles)]
36-
#![allow(forget_copy)]
37-
#![allow(forget_ref)]
36+
#![allow(forgetting_copy_types)]
37+
#![allow(forgetting_references)]
3838
#![allow(array_into_iter)]
3939
#![allow(invalid_atomic_ordering)]
4040
#![allow(invalid_value)]
@@ -77,13 +77,13 @@
7777
#![warn(clippy::invisible_characters)]
7878
#![warn(suspicious_double_ref_op)]
7979
#![warn(drop_bounds)]
80-
#![warn(drop_copy)]
81-
#![warn(drop_ref)]
80+
#![warn(dropping_copy_types)]
81+
#![warn(dropping_references)]
8282
#![warn(for_loops_over_fallibles)]
8383
#![warn(for_loops_over_fallibles)]
8484
#![warn(for_loops_over_fallibles)]
85-
#![warn(forget_copy)]
86-
#![warn(forget_ref)]
85+
#![warn(forgetting_copy_types)]
86+
#![warn(forgetting_references)]
8787
#![warn(array_into_iter)]
8888
#![warn(invalid_atomic_ordering)]
8989
#![warn(invalid_value)]

tests/ui/rename.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
#![allow(clippy::invisible_characters)]
3131
#![allow(suspicious_double_ref_op)]
3232
#![allow(drop_bounds)]
33-
#![allow(drop_copy)]
34-
#![allow(drop_ref)]
33+
#![allow(dropping_copy_types)]
34+
#![allow(dropping_references)]
3535
#![allow(for_loops_over_fallibles)]
36-
#![allow(forget_copy)]
37-
#![allow(forget_ref)]
36+
#![allow(forgetting_copy_types)]
37+
#![allow(forgetting_references)]
3838
#![allow(array_into_iter)]
3939
#![allow(invalid_atomic_ordering)]
4040
#![allow(invalid_value)]

tests/ui/rename.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,17 @@ error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
186186
LL | #![warn(clippy::drop_bounds)]
187187
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds`
188188

189-
error: lint `clippy::drop_copy` has been renamed to `drop_copy`
189+
error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types`
190190
--> $DIR/rename.rs:80:9
191191
|
192192
LL | #![warn(clippy::drop_copy)]
193-
| ^^^^^^^^^^^^^^^^^ help: use the new name: `drop_copy`
193+
| ^^^^^^^^^^^^^^^^^ help: use the new name: `dropping_copy_types`
194194

195-
error: lint `clippy::drop_ref` has been renamed to `drop_ref`
195+
error: lint `clippy::drop_ref` has been renamed to `dropping_references`
196196
--> $DIR/rename.rs:81:9
197197
|
198198
LL | #![warn(clippy::drop_ref)]
199-
| ^^^^^^^^^^^^^^^^ help: use the new name: `drop_ref`
199+
| ^^^^^^^^^^^^^^^^ help: use the new name: `dropping_references`
200200

201201
error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles`
202202
--> $DIR/rename.rs:82:9
@@ -216,17 +216,17 @@ error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_ov
216216
LL | #![warn(clippy::for_loops_over_fallibles)]
217217
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
218218

219-
error: lint `clippy::forget_copy` has been renamed to `forget_copy`
219+
error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types`
220220
--> $DIR/rename.rs:85:9
221221
|
222222
LL | #![warn(clippy::forget_copy)]
223-
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forget_copy`
223+
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types`
224224

225-
error: lint `clippy::forget_ref` has been renamed to `forget_ref`
225+
error: lint `clippy::forget_ref` has been renamed to `forgetting_references`
226226
--> $DIR/rename.rs:86:9
227227
|
228228
LL | #![warn(clippy::forget_ref)]
229-
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `forget_ref`
229+
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references`
230230

231231
error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
232232
--> $DIR/rename.rs:87:9

0 commit comments

Comments
 (0)