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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 2 additions & 2 deletions
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

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, 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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)