Skip to content

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

+1-1
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

+4-4
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+2-2
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

src/tools/miri/tests/fail/uninit_buffer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@error-in-other-file: memory is uninitialized at [0x4..0x10]
22

3-
#![allow(drop_copy)]
3+
#![allow(dropping_copy_types)]
44

55
use std::alloc::{alloc, dealloc, Layout};
66
use std::slice::from_raw_parts;

src/tools/miri/tests/fail/uninit_buffer_with_provenance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@error-in-other-file: memory is uninitialized at [0x4..0x8]
22
//@normalize-stderr-test: "a[0-9]+" -> "ALLOC"
33
#![feature(strict_provenance)]
4-
#![allow(drop_copy)]
4+
#![allow(dropping_copy_types)]
55

66
// Test printing allocations that contain single-byte provenance.
77

src/tools/miri/tests/pass/stacked-borrows/zst-field-retagging-terminates.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@compile-flags: -Zmiri-retag-fields
22
// Checks that the test does not run forever (which relies on a fast path).
33

4-
#![allow(drop_copy)]
4+
#![allow(dropping_copy_types)]
55

66
fn main() {
77
let array = [(); usize::MAX];

tests/ui/associated-inherent-types/inference.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#![feature(inherent_associated_types)]
55
#![allow(incomplete_features)]
6-
#![allow(drop_copy)]
6+
#![allow(dropping_copy_types)]
77

88
use std::convert::identity;
99

tests/ui/borrowck/borrowck-field-sensitivity-rpass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22
#![allow(unused_mut)]
33
#![allow(unused_variables)]
4-
#![allow(drop_copy)]
4+
#![allow(dropping_copy_types)]
55
// pretty-expanded FIXME #23616
66

77
struct A { a: isize, b: Box<isize> }

tests/ui/borrowck/borrowck-use-mut-borrow-rpass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22
// pretty-expanded FIXME #23616
33

4-
#![allow(drop_copy)]
4+
#![allow(dropping_copy_types)]
55

66
struct A { a: isize, b: Box<isize> }
77

tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22

33
#![warn(rust_2021_incompatible_closure_captures)]
4-
#![allow(drop_ref, drop_copy)]
4+
#![allow(drop_ref, dropping_copy_types)]
55

66
fn main() {
77
if let a = "" {

tests/ui/crate-leading-sep.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22
// pretty-expanded FIXME #23616
33

4-
#![allow(drop_copy)]
4+
#![allow(dropping_copy_types)]
55

66
fn main() {
77
use ::std::mem;

tests/ui/drop/repeat-drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22
// needs-unwind
33

4-
#![allow(drop_ref, drop_copy)]
4+
#![allow(drop_ref, dropping_copy_types)]
55

66
static mut CHECK: usize = 0;
77

tests/ui/generator/drop-env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//[nomiropt]compile-flags: -Z mir-opt-level=0
55

66
#![feature(generators, generator_trait)]
7-
#![allow(drop_copy)]
7+
#![allow(dropping_copy_types)]
88

99
use std::ops::Generator;
1010
use std::pin::Pin;

tests/ui/generator/issue-57017.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// [drop_tracking_mir] build-pass
66

77
#![feature(generators, negative_impls)]
8-
#![allow(drop_ref, drop_copy)]
8+
#![allow(drop_ref, dropping_copy_types)]
99

1010
macro_rules! type_combinations {
1111
(

tests/ui/generator/non-static-is-unpin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// run-pass
44

55
#![feature(generators, generator_trait)]
6-
#![allow(drop_copy)]
6+
#![allow(dropping_copy_types)]
77

88
use std::marker::{PhantomPinned, Unpin};
99

tests/ui/generator/resume-arg-size.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(generators)]
2-
#![allow(drop_copy)]
2+
#![allow(dropping_copy_types)]
33

44
// run-pass
55

tests/ui/hygiene/stdlib-prelude-from-opaque-late.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// check-pass
22

33
#![feature(decl_macro)]
4-
#![allow(drop_copy)]
4+
#![allow(dropping_copy_types)]
55

66
macro mac() {
77
mod m {

tests/ui/lint/drop_copy.rs renamed to tests/ui/lint/dropping_copy_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// check-pass
22

3-
#![warn(drop_copy)]
3+
#![warn(dropping_copy_types)]
44

55
use std::mem::drop;
66
use std::vec::Vec;

tests/ui/lint/drop_copy.stderr renamed to tests/ui/lint/dropping_copy_types.stderr

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
2-
--> $DIR/drop_copy.rs:34:5
2+
--> $DIR/dropping_copy_types.rs:34:5
33
|
44
LL | drop(s1);
55
| ^^^^^--^
@@ -8,13 +8,13 @@ LL | drop(s1);
88
|
99
= note: use `let _ = ...` to ignore the expression or result
1010
note: the lint level is defined here
11-
--> $DIR/drop_copy.rs:3:9
11+
--> $DIR/dropping_copy_types.rs:3:9
1212
|
13-
LL | #![warn(drop_copy)]
14-
| ^^^^^^^^^
13+
LL | #![warn(dropping_copy_types)]
14+
| ^^^^^^^^^^^^^^^^^^^
1515

1616
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
17-
--> $DIR/drop_copy.rs:35:5
17+
--> $DIR/dropping_copy_types.rs:35:5
1818
|
1919
LL | drop(s2);
2020
| ^^^^^--^
@@ -24,7 +24,7 @@ LL | drop(s2);
2424
= note: use `let _ = ...` to ignore the expression or result
2525

2626
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
27-
--> $DIR/drop_copy.rs:36:5
27+
--> $DIR/dropping_copy_types.rs:36:5
2828
|
2929
LL | drop(s3);
3030
| ^^^^^--^
@@ -35,7 +35,7 @@ LL | drop(s3);
3535
= note: `#[warn(drop_ref)]` on by default
3636

3737
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
38-
--> $DIR/drop_copy.rs:37:5
38+
--> $DIR/dropping_copy_types.rs:37:5
3939
|
4040
LL | drop(s4);
4141
| ^^^^^--^
@@ -45,7 +45,7 @@ LL | drop(s4);
4545
= note: use `let _ = ...` to ignore the expression or result
4646

4747
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
48-
--> $DIR/drop_copy.rs:38:5
48+
--> $DIR/dropping_copy_types.rs:38:5
4949
|
5050
LL | drop(s5);
5151
| ^^^^^--^
@@ -55,7 +55,7 @@ LL | drop(s5);
5555
= note: use `let _ = ...` to ignore the expression or result
5656

5757
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
58-
--> $DIR/drop_copy.rs:50:5
58+
--> $DIR/dropping_copy_types.rs:50:5
5959
|
6060
LL | drop(a2);
6161
| ^^^^^--^
@@ -65,7 +65,7 @@ LL | drop(a2);
6565
= note: use `let _ = ...` to ignore the expression or result
6666

6767
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
68-
--> $DIR/drop_copy.rs:52:5
68+
--> $DIR/dropping_copy_types.rs:52:5
6969
|
7070
LL | drop(a4);
7171
| ^^^^^--^
@@ -75,7 +75,7 @@ LL | drop(a4);
7575
= note: use `let _ = ...` to ignore the expression or result
7676

7777
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
78-
--> $DIR/drop_copy.rs:71:13
78+
--> $DIR/dropping_copy_types.rs:71:13
7979
|
8080
LL | drop(println_and(13));
8181
| ^^^^^---------------^
@@ -85,7 +85,7 @@ LL | drop(println_and(13));
8585
= note: use `let _ = ...` to ignore the expression or result
8686

8787
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
88-
--> $DIR/drop_copy.rs:74:14
88+
--> $DIR/dropping_copy_types.rs:74:14
8989
|
9090
LL | 3 if drop(println_and(14)) == () => (),
9191
| ^^^^^---------------^
@@ -95,7 +95,7 @@ LL | 3 if drop(println_and(14)) == () => (),
9595
= note: use `let _ = ...` to ignore the expression or result
9696

9797
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
98-
--> $DIR/drop_copy.rs:76:14
98+
--> $DIR/dropping_copy_types.rs:76:14
9999
|
100100
LL | 4 => drop(2),
101101
| ^^^^^-^

tests/ui/liveness/liveness-unused.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(unused)]
22
#![deny(unused_variables)]
33
#![deny(unused_assignments)]
4-
#![allow(dead_code, non_camel_case_types, trivial_numeric_casts, drop_copy)]
4+
#![allow(dead_code, non_camel_case_types, trivial_numeric_casts, dropping_copy_types)]
55

66
use std::ops::AddAssign;
77

tests/ui/macros/parse-complex-macro-invoc-op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(unused_assignments)]
55
#![allow(unused_variables)]
66
#![allow(stable_features)]
7-
#![allow(drop_copy)]
7+
#![allow(dropping_copy_types)]
88

99
// Test parsing binary operators after macro invocations.
1010

tests/ui/never_type/never-assign-dead-code.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// check-pass
44

55
#![feature(never_type)]
6-
#![allow(drop_copy)]
6+
#![allow(dropping_copy_types)]
77
#![warn(unused)]
88

99
fn main() {

tests/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// check-pass
66
// compile-flags:-Zno-leak-check
77

8-
#![allow(drop_copy)]
8+
#![allow(dropping_copy_types)]
99

1010
fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 {
1111
panic!()

0 commit comments

Comments
 (0)