about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-05-19 11:30:11 +0200
committerUrgau <urgau@numericable.fr>2023-05-21 14:28:09 +0200
commit6b08a745a4d59e9bf51d2d591c569c9e758bd02a (patch)
treea76b8c68be69e58e5a04ddbd3256e74f6b500834
parentc93d9c1794eb8d57fd2f108547192c3aeb92b505 (diff)
downloadrust-6b08a745a4d59e9bf51d2d591c569c9e758bd02a.tar.gz
rust-6b08a745a4d59e9bf51d2d591c569c9e758bd02a.zip
Rename `forget_ref` lint to `forgetting_references`
-rw-r--r--compiler/rustc_lint/messages.ftl2
-rw-r--r--compiler/rustc_lint/src/drop_forget_useless.rs8
-rw-r--r--compiler/rustc_lint/src/lints.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/drop_forget_ref.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/renamed_lints.rs2
-rw-r--r--src/tools/clippy/tests/ui/rename.fixed4
-rw-r--r--src/tools/clippy/tests/ui/rename.rs2
-rw-r--r--src/tools/clippy/tests/ui/rename.stderr4
-rw-r--r--tests/ui/lint/forgetting_copy_types.stderr2
-rw-r--r--tests/ui/lint/forgetting_references.rs (renamed from tests/ui/lint/forget_ref.rs)2
-rw-r--r--tests/ui/lint/forgetting_references.stderr (renamed from tests/ui/lint/forget_ref.stderr)24
11 files changed, 27 insertions, 27 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl
index b0ccbe4b1f1..e1658d3ff82 100644
--- a/compiler/rustc_lint/messages.ftl
+++ b/compiler/rustc_lint/messages.ftl
@@ -529,7 +529,7 @@ lint_dropping_copy_types = calls to `std::mem::drop` with a value that implement
     .label = argument has type `{$arg_ty}`
     .note = use `let _ = ...` to ignore the expression or result
 
-lint_forget_ref = calls to `std::mem::forget` with a reference instead of an owned value does nothing
+lint_forgetting_references = calls to `std::mem::forget` with a reference instead of an owned value does nothing
     .label = argument has type `{$arg_ty}`
     .note = use `let _ = ...` to ignore the expression or result
 
diff --git a/compiler/rustc_lint/src/drop_forget_useless.rs b/compiler/rustc_lint/src/drop_forget_useless.rs
index b1199096d7c..ed2b384805e 100644
--- a/compiler/rustc_lint/src/drop_forget_useless.rs
+++ b/compiler/rustc_lint/src/drop_forget_useless.rs
@@ -35,7 +35,7 @@ declare_lint! {
 }
 
 declare_lint! {
-    /// The `forget_ref` lint checks for calls to `std::mem::forget` with a reference
+    /// The `forgetting_references` lint checks for calls to `std::mem::forget` with a reference
     /// instead of an owned value.
     ///
     /// ### Example
@@ -52,7 +52,7 @@ declare_lint! {
     /// Calling `forget` on a reference will only forget the
     /// reference itself, which is a no-op. It will not forget the underlying
     /// referenced value, which is likely what was intended.
-    pub FORGET_REF,
+    pub FORGETTING_REFERENCES,
     Warn,
     "calls to `std::mem::forget` with a reference instead of an owned value"
 }
@@ -109,7 +109,7 @@ declare_lint! {
     "calls to `std::mem::forget` with a value that implements Copy"
 }
 
-declare_lint_pass!(DropForgetUseless => [DROPPING_REFERENCES, FORGET_REF, DROPPING_COPY_TYPES, FORGETTING_COPY_TYPES]);
+declare_lint_pass!(DropForgetUseless => [DROPPING_REFERENCES, FORGETTING_REFERENCES, DROPPING_COPY_TYPES, FORGETTING_COPY_TYPES]);
 
 impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
@@ -126,7 +126,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
                     cx.emit_spanned_lint(DROPPING_REFERENCES, expr.span, DropRefDiag { arg_ty, label: arg.span });
                 },
                 sym::mem_forget if arg_ty.is_ref() => {
-                    cx.emit_spanned_lint(FORGET_REF, expr.span, ForgetRefDiag { arg_ty, label: arg.span });
+                    cx.emit_spanned_lint(FORGETTING_REFERENCES, expr.span, ForgetRefDiag { arg_ty, label: arg.span });
                 },
                 sym::mem_drop if is_copy && !drop_is_single_call_in_arm => {
                     cx.emit_spanned_lint(DROPPING_COPY_TYPES, expr.span, DropCopyDiag { arg_ty, label: arg.span });
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index aebfa6f3078..de1c2be2875 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -682,7 +682,7 @@ pub struct DropCopyDiag<'a> {
 }
 
 #[derive(LintDiagnostic)]
-#[diag(lint_forget_ref)]
+#[diag(lint_forgetting_references)]
 #[note]
 pub struct ForgetRefDiag<'a> {
     pub arg_ty: Ty<'a>,
diff --git a/src/tools/clippy/clippy_lints/src/drop_forget_ref.rs b/src/tools/clippy/clippy_lints/src/drop_forget_ref.rs
index 00211d65094..9c60edb1794 100644
--- a/src/tools/clippy/clippy_lints/src/drop_forget_ref.rs
+++ b/src/tools/clippy/clippy_lints/src/drop_forget_ref.rs
@@ -98,7 +98,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetRef {
             let is_copy = is_copy(cx, arg_ty);
             let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
             let (lint, msg) = match fn_name {
-                // early return for uplifted lints: dropping_references, dropping_copy_types, forget_ref, forgetting_copy_types
+                // early return for uplifted lints: dropping_references, dropping_copy_types, forgetting_references, forgetting_copy_types
                 sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => return,
                 sym::mem_forget if arg_ty.is_ref() => return,
                 sym::mem_drop if is_copy && !drop_is_single_call_in_arm => return,
diff --git a/src/tools/clippy/clippy_lints/src/renamed_lints.rs b/src/tools/clippy/clippy_lints/src/renamed_lints.rs
index 4d1a462d110..b0db56bb417 100644
--- a/src/tools/clippy/clippy_lints/src/renamed_lints.rs
+++ b/src/tools/clippy/clippy_lints/src/renamed_lints.rs
@@ -39,7 +39,7 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
     ("clippy::for_loop_over_result", "for_loops_over_fallibles"),
     ("clippy::for_loops_over_fallibles", "for_loops_over_fallibles"),
     ("clippy::forget_copy", "forgetting_copy_types"),
-    ("clippy::forget_ref", "forget_ref"),
+    ("clippy::forget_ref", "forgetting_references"),
     ("clippy::into_iter_on_array", "array_into_iter"),
     ("clippy::invalid_atomic_ordering", "invalid_atomic_ordering"),
     ("clippy::invalid_ref", "invalid_value"),
diff --git a/src/tools/clippy/tests/ui/rename.fixed b/src/tools/clippy/tests/ui/rename.fixed
index a4fb4fbffdf..dfe45dec8a7 100644
--- a/src/tools/clippy/tests/ui/rename.fixed
+++ b/src/tools/clippy/tests/ui/rename.fixed
@@ -34,7 +34,7 @@
 #![allow(dropping_references)]
 #![allow(for_loops_over_fallibles)]
 #![allow(forgetting_copy_types)]
-#![allow(forget_ref)]
+#![allow(forgetting_references)]
 #![allow(array_into_iter)]
 #![allow(invalid_atomic_ordering)]
 #![allow(invalid_value)]
@@ -83,7 +83,7 @@
 #![warn(for_loops_over_fallibles)]
 #![warn(for_loops_over_fallibles)]
 #![warn(forgetting_copy_types)]
-#![warn(forget_ref)]
+#![warn(forgetting_references)]
 #![warn(array_into_iter)]
 #![warn(invalid_atomic_ordering)]
 #![warn(invalid_value)]
diff --git a/src/tools/clippy/tests/ui/rename.rs b/src/tools/clippy/tests/ui/rename.rs
index bb833c95346..ce8eca5a308 100644
--- a/src/tools/clippy/tests/ui/rename.rs
+++ b/src/tools/clippy/tests/ui/rename.rs
@@ -34,7 +34,7 @@
 #![allow(dropping_references)]
 #![allow(for_loops_over_fallibles)]
 #![allow(forgetting_copy_types)]
-#![allow(forget_ref)]
+#![allow(forgetting_references)]
 #![allow(array_into_iter)]
 #![allow(invalid_atomic_ordering)]
 #![allow(invalid_value)]
diff --git a/src/tools/clippy/tests/ui/rename.stderr b/src/tools/clippy/tests/ui/rename.stderr
index 8bbd046bbf3..3fca60aa2eb 100644
--- a/src/tools/clippy/tests/ui/rename.stderr
+++ b/src/tools/clippy/tests/ui/rename.stderr
@@ -222,11 +222,11 @@ error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types`
 LL | #![warn(clippy::forget_copy)]
    |         ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types`
 
-error: lint `clippy::forget_ref` has been renamed to `forget_ref`
+error: lint `clippy::forget_ref` has been renamed to `forgetting_references`
   --> $DIR/rename.rs:86:9
    |
 LL | #![warn(clippy::forget_ref)]
-   |         ^^^^^^^^^^^^^^^^^^ help: use the new name: `forget_ref`
+   |         ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references`
 
 error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
   --> $DIR/rename.rs:87:9
diff --git a/tests/ui/lint/forgetting_copy_types.stderr b/tests/ui/lint/forgetting_copy_types.stderr
index cf4e1845f56..36d1ef5c53e 100644
--- a/tests/ui/lint/forgetting_copy_types.stderr
+++ b/tests/ui/lint/forgetting_copy_types.stderr
@@ -32,7 +32,7 @@ LL |     forget(s3);
    |            argument has type `&SomeStruct`
    |
    = note: use `let _ = ...` to ignore the expression or result
-   = note: `#[warn(forget_ref)]` on by default
+   = note: `#[warn(forgetting_references)]` on by default
 
 warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
   --> $DIR/forgetting_copy_types.rs:37:5
diff --git a/tests/ui/lint/forget_ref.rs b/tests/ui/lint/forgetting_references.rs
index 13f6d4be3d1..bd51e980031 100644
--- a/tests/ui/lint/forget_ref.rs
+++ b/tests/ui/lint/forgetting_references.rs
@@ -1,6 +1,6 @@
 // check-pass
 
-#![warn(forget_ref)]
+#![warn(forgetting_references)]
 
 use std::mem::forget;
 
diff --git a/tests/ui/lint/forget_ref.stderr b/tests/ui/lint/forgetting_references.stderr
index 63fc7791980..5624b690789 100644
--- a/tests/ui/lint/forget_ref.stderr
+++ b/tests/ui/lint/forgetting_references.stderr
@@ -1,5 +1,5 @@
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:10:5
+  --> $DIR/forgetting_references.rs:10:5
    |
 LL |     forget(&SomeStruct);
    |     ^^^^^^^-----------^
@@ -8,13 +8,13 @@ LL |     forget(&SomeStruct);
    |
    = note: use `let _ = ...` to ignore the expression or result
 note: the lint level is defined here
-  --> $DIR/forget_ref.rs:3:9
+  --> $DIR/forgetting_references.rs:3:9
    |
-LL | #![warn(forget_ref)]
-   |         ^^^^^^^^^^
+LL | #![warn(forgetting_references)]
+   |         ^^^^^^^^^^^^^^^^^^^^^
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:13:5
+  --> $DIR/forgetting_references.rs:13:5
    |
 LL |     forget(&owned);
    |     ^^^^^^^------^
@@ -24,7 +24,7 @@ LL |     forget(&owned);
    = note: use `let _ = ...` to ignore the expression or result
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:14:5
+  --> $DIR/forgetting_references.rs:14:5
    |
 LL |     forget(&&owned);
    |     ^^^^^^^-------^
@@ -34,7 +34,7 @@ LL |     forget(&&owned);
    = note: use `let _ = ...` to ignore the expression or result
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:15:5
+  --> $DIR/forgetting_references.rs:15:5
    |
 LL |     forget(&mut owned);
    |     ^^^^^^^----------^
@@ -44,7 +44,7 @@ LL |     forget(&mut owned);
    = note: use `let _ = ...` to ignore the expression or result
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:19:5
+  --> $DIR/forgetting_references.rs:19:5
    |
 LL |     forget(&*reference1);
    |     ^^^^^^^------------^
@@ -54,7 +54,7 @@ LL |     forget(&*reference1);
    = note: use `let _ = ...` to ignore the expression or result
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:22:5
+  --> $DIR/forgetting_references.rs:22:5
    |
 LL |     forget(reference2);
    |     ^^^^^^^----------^
@@ -64,7 +64,7 @@ LL |     forget(reference2);
    = note: use `let _ = ...` to ignore the expression or result
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:25:5
+  --> $DIR/forgetting_references.rs:25:5
    |
 LL |     forget(reference3);
    |     ^^^^^^^----------^
@@ -74,7 +74,7 @@ LL |     forget(reference3);
    = note: use `let _ = ...` to ignore the expression or result
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:30:5
+  --> $DIR/forgetting_references.rs:30:5
    |
 LL |     forget(&val);
    |     ^^^^^^^----^
@@ -84,7 +84,7 @@ LL |     forget(&val);
    = note: use `let _ = ...` to ignore the expression or result
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
-  --> $DIR/forget_ref.rs:38:5
+  --> $DIR/forgetting_references.rs:38:5
    |
 LL |     std::mem::forget(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^-----------^