Skip to content

Commit c93d9c1

Browse files
committed
Rename drop_ref lint to dropping_references
1 parent 85a1828 commit c93d9c1

30 files changed

+50
-50
lines changed

compiler/rustc_lint/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its ass
521521
522522
lint_opaque_hidden_inferred_bound_sugg = add this bound
523523
524-
lint_drop_ref = calls to `std::mem::drop` with a reference instead of an owned value does nothing
524+
lint_dropping_references = calls to `std::mem::drop` with a reference instead of an owned value does nothing
525525
.label = argument has type `{$arg_ty}`
526526
.note = use `let _ = ...` to ignore the expression or result
527527

compiler/rustc_lint/src/drop_forget_useless.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{
77
};
88

99
declare_lint! {
10-
/// The `drop_ref` lint checks for calls to `std::mem::drop` with a reference
10+
/// The `dropping_references` lint checks for calls to `std::mem::drop` with a reference
1111
/// instead of an owned value.
1212
///
1313
/// ### Example
@@ -29,7 +29,7 @@ declare_lint! {
2929
/// reference itself, which is a no-op. It will not call the `drop` method (from
3030
/// the `Drop` trait implementation) on the underlying referenced value, which
3131
/// is likely what was intended.
32-
pub DROP_REF,
32+
pub DROPPING_REFERENCES,
3333
Warn,
3434
"calls to `std::mem::drop` with a reference instead of an owned value"
3535
}
@@ -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, DROPPING_COPY_TYPES, FORGETTING_COPY_TYPES]);
112+
declare_lint_pass!(DropForgetUseless => [DROPPING_REFERENCES, FORGET_REF, DROPPING_COPY_TYPES, FORGETTING_COPY_TYPES]);
113113

114114
impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
115115
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
@@ -123,7 +123,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
123123
let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
124124
match fn_name {
125125
sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => {
126-
cx.emit_spanned_lint(DROP_REF, expr.span, DropRefDiag { arg_ty, label: arg.span });
126+
cx.emit_spanned_lint(DROPPING_REFERENCES, expr.span, DropRefDiag { arg_ty, label: arg.span });
127127
},
128128
sym::mem_forget if arg_ty.is_ref() => {
129129
cx.emit_spanned_lint(FORGET_REF, expr.span, ForgetRefDiag { arg_ty, label: arg.span });

compiler/rustc_lint/src/lints.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,9 @@ pub struct ForLoopsOverFalliblesSuggestion<'a> {
662662
pub end_span: Span,
663663
}
664664

665-
// drop_ref.rs
665+
// drop_forget_useless.rs
666666
#[derive(LintDiagnostic)]
667-
#[diag(lint_drop_ref)]
667+
#[diag(lint_dropping_references)]
668668
#[note]
669669
pub struct DropRefDiag<'a> {
670670
pub arg_ty: Ty<'a>,

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, dropping_copy_types, forget_ref, forgetting_copy_types
101+
// early return for uplifted lints: dropping_references, dropping_copy_types, forget_ref, 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,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
3434
("clippy::clone_double_ref", "suspicious_double_ref_op"),
3535
("clippy::drop_bounds", "drop_bounds"),
3636
("clippy::drop_copy", "dropping_copy_types"),
37-
("clippy::drop_ref", "drop_ref"),
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"),

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#![allow(suspicious_double_ref_op)]
3232
#![allow(drop_bounds)]
3333
#![allow(dropping_copy_types)]
34-
#![allow(drop_ref)]
34+
#![allow(dropping_references)]
3535
#![allow(for_loops_over_fallibles)]
3636
#![allow(forgetting_copy_types)]
3737
#![allow(forget_ref)]
@@ -78,7 +78,7 @@
7878
#![warn(suspicious_double_ref_op)]
7979
#![warn(drop_bounds)]
8080
#![warn(dropping_copy_types)]
81-
#![warn(drop_ref)]
81+
#![warn(dropping_references)]
8282
#![warn(for_loops_over_fallibles)]
8383
#![warn(for_loops_over_fallibles)]
8484
#![warn(for_loops_over_fallibles)]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#![allow(suspicious_double_ref_op)]
3232
#![allow(drop_bounds)]
3333
#![allow(dropping_copy_types)]
34-
#![allow(drop_ref)]
34+
#![allow(dropping_references)]
3535
#![allow(for_loops_over_fallibles)]
3636
#![allow(forgetting_copy_types)]
3737
#![allow(forget_ref)]

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types`
192192
LL | #![warn(clippy::drop_copy)]
193193
| ^^^^^^^^^^^^^^^^^ 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

src/tools/miri/tests/fail/stacked_borrows/illegal_write2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(drop_ref)]
1+
#![allow(dropping_references)]
22

33
fn main() {
44
let target = &mut 42;

tests/ui/borrowck/borrowck-closures-slice-patterns-ok.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Check that closure captures for slice patterns are inferred correctly
22

33
#![allow(unused_variables)]
4-
#![allow(drop_ref)]
4+
#![allow(dropping_references)]
55

66
// run-pass
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, dropping_copy_types)]
4+
#![allow(dropping_references, dropping_copy_types)]
55

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

tests/ui/closures/2229_closure_analysis/optimization/edge_case_run_pass.rs

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

44
#![allow(unused)]
55
#![allow(dead_code)]
6-
#![allow(drop_ref)]
6+
#![allow(dropping_references)]
77

88
struct Int(i32);
99
struct B<'a>(&'a i32);

tests/ui/closures/2229_closure_analysis/run_pass/drop_then_use_fake_reads.rs

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

44
#![feature(rustc_attrs)]
5-
#![allow(drop_ref)]
5+
#![allow(dropping_references)]
66

77
fn main() {
88
let mut x = 1;

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, dropping_copy_types)]
4+
#![allow(dropping_references, dropping_copy_types)]
55

66
static mut CHECK: usize = 0;
77

tests/ui/explicit/explicit-call-to-supertrait-dtor.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![allow(drop_ref)]
3+
#![allow(dropping_references)]
44

55
struct Foo {
66
x: isize

tests/ui/explicit/explicit-call-to-supertrait-dtor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![allow(drop_ref)]
3+
#![allow(dropping_references)]
44

55
struct Foo {
66
x: isize

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, dropping_copy_types)]
8+
#![allow(dropping_references, dropping_copy_types)]
99

1010
macro_rules! type_combinations {
1111
(

tests/ui/illegal-ufcs-drop.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![allow(drop_ref)]
3+
#![allow(dropping_references)]
44

55
struct Foo;
66

tests/ui/illegal-ufcs-drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![allow(drop_ref)]
3+
#![allow(dropping_references)]
44

55
struct Foo;
66

tests/ui/lint/dropping_copy_types.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LL | drop(s3);
3232
| argument has type `&SomeStruct`
3333
|
3434
= note: use `let _ = ...` to ignore the expression or result
35-
= note: `#[warn(drop_ref)]` on by default
35+
= note: `#[warn(dropping_references)]` on by default
3636

3737
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
3838
--> $DIR/dropping_copy_types.rs:37:5

tests/ui/lint/drop_ref.rs renamed to tests/ui/lint/dropping_references.rs

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

3-
#![warn(drop_ref)]
3+
#![warn(dropping_references)]
44

55
struct SomeStruct;
66

tests/ui/lint/drop_ref.stderr renamed to tests/ui/lint/dropping_references.stderr

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

1616
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
17-
--> $DIR/drop_ref.rs:11:5
17+
--> $DIR/dropping_references.rs:11:5
1818
|
1919
LL | drop(&owned1);
2020
| ^^^^^-------^
@@ -24,7 +24,7 @@ LL | drop(&owned1);
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_ref.rs:12:5
27+
--> $DIR/dropping_references.rs:12:5
2828
|
2929
LL | drop(&&owned1);
3030
| ^^^^^--------^
@@ -34,7 +34,7 @@ LL | drop(&&owned1);
3434
= note: use `let _ = ...` to ignore the expression or result
3535

3636
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
37-
--> $DIR/drop_ref.rs:13:5
37+
--> $DIR/dropping_references.rs:13:5
3838
|
3939
LL | drop(&mut owned1);
4040
| ^^^^^-----------^
@@ -44,7 +44,7 @@ LL | drop(&mut owned1);
4444
= note: use `let _ = ...` to ignore the expression or result
4545

4646
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
47-
--> $DIR/drop_ref.rs:17:5
47+
--> $DIR/dropping_references.rs:17:5
4848
|
4949
LL | drop(reference1);
5050
| ^^^^^----------^
@@ -54,7 +54,7 @@ LL | drop(reference1);
5454
= note: use `let _ = ...` to ignore the expression or result
5555

5656
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
57-
--> $DIR/drop_ref.rs:20:5
57+
--> $DIR/dropping_references.rs:20:5
5858
|
5959
LL | drop(reference2);
6060
| ^^^^^----------^
@@ -64,7 +64,7 @@ LL | drop(reference2);
6464
= note: use `let _ = ...` to ignore the expression or result
6565

6666
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
67-
--> $DIR/drop_ref.rs:23:5
67+
--> $DIR/dropping_references.rs:23:5
6868
|
6969
LL | drop(reference3);
7070
| ^^^^^----------^
@@ -74,7 +74,7 @@ LL | drop(reference3);
7474
= note: use `let _ = ...` to ignore the expression or result
7575

7676
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
77-
--> $DIR/drop_ref.rs:28:5
77+
--> $DIR/dropping_references.rs:28:5
7878
|
7979
LL | drop(&val);
8080
| ^^^^^----^
@@ -84,7 +84,7 @@ LL | drop(&val);
8484
= note: use `let _ = ...` to ignore the expression or result
8585

8686
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
87-
--> $DIR/drop_ref.rs:36:5
87+
--> $DIR/dropping_references.rs:36:5
8888
|
8989
LL | std::mem::drop(&SomeStruct);
9090
| ^^^^^^^^^^^^^^^-----------^
@@ -94,7 +94,7 @@ LL | std::mem::drop(&SomeStruct);
9494
= note: use `let _ = ...` to ignore the expression or result
9595

9696
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
97-
--> $DIR/drop_ref.rs:91:13
97+
--> $DIR/dropping_references.rs:91:13
9898
|
9999
LL | drop(println_and(&13));
100100
| ^^^^^----------------^
@@ -104,7 +104,7 @@ LL | drop(println_and(&13));
104104
= note: use `let _ = ...` to ignore the expression or result
105105

106106
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
107-
--> $DIR/drop_ref.rs:94:14
107+
--> $DIR/dropping_references.rs:94:14
108108
|
109109
LL | 3 if drop(println_and(&14)) == () => (),
110110
| ^^^^^----------------^
@@ -114,7 +114,7 @@ LL | 3 if drop(println_and(&14)) == () => (),
114114
= note: use `let _ = ...` to ignore the expression or result
115115

116116
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
117-
--> $DIR/drop_ref.rs:96:14
117+
--> $DIR/dropping_references.rs:96:14
118118
|
119119
LL | 4 => drop(&2),
120120
| ^^^^^--^

tests/ui/nll/ty-outlives/projection-body.rs

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

6-
#![allow(drop_ref)]
6+
#![allow(dropping_references)]
77

88
trait MyTrait<'a> {
99
type Output;

tests/ui/or-patterns/or-patterns-default-binding-modes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#![allow(irrefutable_let_patterns)]
66
#![allow(dropping_copy_types)]
7-
#![allow(drop_ref)]
7+
#![allow(dropping_references)]
88

99
fn main() {
1010
// A regression test for a mistake we made at one point:

tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Test `@` patterns combined with `box` patterns.
44

5-
#![allow(drop_ref)]
5+
#![allow(dropping_references)]
66
#![allow(dropping_copy_types)]
77

88
#![feature(box_patterns)]

tests/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs

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

3-
#![allow(drop_ref)]
3+
#![allow(dropping_references)]
44

55
fn main() {}
66

tests/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs

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

3-
#![allow(drop_ref)]
3+
#![allow(dropping_references)]
44

55
fn main() {
66
struct U;

tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs

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

44
// check-pass
55

6-
#![allow(drop_ref)]
6+
#![allow(dropping_references)]
77

88
// aux-build:monovariants.rs
99
extern crate monovariants;

0 commit comments

Comments
 (0)