Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1c7ab18

Browse files
committed
Rename drop_copy lint to dropping_copy_types
1 parent d77014a commit 1c7ab18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+60
-60
lines changed

compiler/rustc_lint/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ lint_drop_ref = calls to `std::mem::drop` with a reference instead of an owned v
525525
.label = argument has type `{$arg_ty}`
526526
.note = use `let _ = ...` to ignore the expression or result
527527
528-
lint_drop_copy = calls to `std::mem::drop` with a value that implements `Copy` does nothing
528+
lint_dropping_copy_types = calls to `std::mem::drop` with a value that implements `Copy` does nothing
529529
.label = argument has type `{$arg_ty}`
530530
.note = use `let _ = ...` to ignore the expression or result
531531

compiler/rustc_lint/src/drop_forget_useless.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ declare_lint! {
5858
}
5959

6060
declare_lint! {
61-
/// The `drop_copy` lint checks for calls to `std::mem::drop` with a value
61+
/// The `dropping_copy_types` lint checks for calls to `std::mem::drop` with a value
6262
/// that derives the Copy trait.
6363
///
6464
/// ### Example
@@ -76,7 +76,7 @@ declare_lint! {
7676
/// Calling `std::mem::drop` [does nothing for types that
7777
/// implement Copy](https://doc.rust-lang.org/std/mem/fn.drop.html), since the
7878
/// value will be copied and moved into the function on invocation.
79-
pub DROP_COPY,
79+
pub DROPPING_COPY_TYPES,
8080
Warn,
8181
"calls to `std::mem::drop` with a value that implements Copy"
8282
}
@@ -109,7 +109,7 @@ declare_lint! {
109109
"calls to `std::mem::forget` with a value that implements Copy"
110110
}
111111

112-
declare_lint_pass!(DropForgetUseless => [DROP_REF, FORGET_REF, DROP_COPY, FORGET_COPY]);
112+
declare_lint_pass!(DropForgetUseless => [DROP_REF, FORGET_REF, DROPPING_COPY_TYPES, FORGET_COPY]);
113113

114114
impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
115115
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
@@ -129,7 +129,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
129129
cx.emit_spanned_lint(FORGET_REF, expr.span, ForgetRefDiag { arg_ty, label: arg.span });
130130
},
131131
sym::mem_drop if is_copy && !drop_is_single_call_in_arm => {
132-
cx.emit_spanned_lint(DROP_COPY, expr.span, DropCopyDiag { arg_ty, label: arg.span });
132+
cx.emit_spanned_lint(DROPPING_COPY_TYPES, expr.span, DropCopyDiag { arg_ty, label: arg.span });
133133
}
134134
sym::mem_forget if is_copy => {
135135
cx.emit_spanned_lint(FORGET_COPY, expr.span, ForgetCopyDiag { arg_ty, label: arg.span });

compiler/rustc_lint/src/lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ pub struct DropRefDiag<'a> {
673673
}
674674

675675
#[derive(LintDiagnostic)]
676-
#[diag(lint_drop_copy)]
676+
#[diag(lint_dropping_copy_types)]
677677
#[note]
678678
pub struct DropCopyDiag<'a> {
679679
pub arg_ty: Ty<'a>,

library/core/src/mem/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ pub const fn replace<T>(dest: &mut T, src: T) -> T {
968968
/// Integers and other types implementing [`Copy`] are unaffected by `drop`.
969969
///
970970
/// ```
971-
/// # #![cfg_attr(not(bootstrap), allow(drop_copy))]
971+
/// # #![cfg_attr(not(bootstrap), allow(dropping_copy_types))]
972972
/// #[derive(Copy, Clone)]
973973
/// struct Foo(u8);
974974
///

src/tools/clippy/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: drop_ref, dropping_copy_types, forget_ref, forget_copy
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,

src/tools/clippy/clippy_lints/src/renamed_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ 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"),
36+
("clippy::drop_copy", "dropping_copy_types"),
3737
("clippy::drop_ref", "drop_ref"),
3838
("clippy::for_loop_over_option", "for_loops_over_fallibles"),
3939
("clippy::for_loop_over_result", "for_loops_over_fallibles"),

src/tools/clippy/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;

src/tools/clippy/tests/ui/rename.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#![allow(clippy::invisible_characters)]
3131
#![allow(suspicious_double_ref_op)]
3232
#![allow(drop_bounds)]
33-
#![allow(drop_copy)]
33+
#![allow(dropping_copy_types)]
3434
#![allow(drop_ref)]
3535
#![allow(for_loops_over_fallibles)]
3636
#![allow(forget_copy)]
@@ -77,7 +77,7 @@
7777
#![warn(clippy::invisible_characters)]
7878
#![warn(suspicious_double_ref_op)]
7979
#![warn(drop_bounds)]
80-
#![warn(drop_copy)]
80+
#![warn(dropping_copy_types)]
8181
#![warn(drop_ref)]
8282
#![warn(for_loops_over_fallibles)]
8383
#![warn(for_loops_over_fallibles)]

src/tools/clippy/tests/ui/rename.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#![allow(clippy::invisible_characters)]
3131
#![allow(suspicious_double_ref_op)]
3232
#![allow(drop_bounds)]
33-
#![allow(drop_copy)]
33+
#![allow(dropping_copy_types)]
3434
#![allow(drop_ref)]
3535
#![allow(for_loops_over_fallibles)]
3636
#![allow(forget_copy)]

src/tools/clippy/tests/ui/rename.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ 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

195195
error: lint `clippy::drop_ref` has been renamed to `drop_ref`
196196
--> $DIR/rename.rs:81:9

0 commit comments

Comments
 (0)