about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-04-10 11:55:37 +0200
committerUrgau <urgau@numericable.fr>2023-05-10 19:36:02 +0200
commit457fa953a2ed374630e1f5cd0d8c599c2b4b0609 (patch)
tree2be84545bfa2f0b425000ea1f79d1ac65c80757b /compiler/rustc_lint
parent77773ad002f9bd9fc2124b964bebad94b5f5d286 (diff)
downloadrust-457fa953a2ed374630e1f5cd0d8c599c2b4b0609.tar.gz
rust-457fa953a2ed374630e1f5cd0d8c599c2b4b0609.zip
Use label instead of note to be more consistent with other lints
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/messages.ftl8
-rw-r--r--compiler/rustc_lint/src/drop_forget_useless.rs8
-rw-r--r--compiler/rustc_lint/src/lints.rs16
3 files changed, 16 insertions, 16 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl
index 0db4b3160df..63424148e4d 100644
--- a/compiler/rustc_lint/messages.ftl
+++ b/compiler/rustc_lint/messages.ftl
@@ -522,13 +522,13 @@ lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its ass
 lint_opaque_hidden_inferred_bound_sugg = add this bound
 
 lint_drop_ref = calls to `std::mem::drop` with a reference instead of an owned value
-    .note = argument has type `{$arg_ty}`
+    .label = argument has type `{$arg_ty}`
 
 lint_drop_copy = calls to `std::mem::drop` with a value that implements `Copy`.
-    .note = argument has type `{$arg_ty}`
+    .label = argument has type `{$arg_ty}`
 
 lint_forget_ref = calls to `std::mem::forget` with a reference instead of an owned value
-    .note = argument has type `{$arg_ty}`
+    .label = argument has type `{$arg_ty}`
 
 lint_forget_copy = calls to `std::mem::forget` with a value that implements `Copy`.
-    .note = argument has type `{$arg_ty}`
+    .label = argument has type `{$arg_ty}`
diff --git a/compiler/rustc_lint/src/drop_forget_useless.rs b/compiler/rustc_lint/src/drop_forget_useless.rs
index e72439439a4..259abc2af11 100644
--- a/compiler/rustc_lint/src/drop_forget_useless.rs
+++ b/compiler/rustc_lint/src/drop_forget_useless.rs
@@ -123,16 +123,16 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
             let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
             match fn_name {
                 sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => {
-                    cx.emit_spanned_lint(DROP_REF, expr.span, DropRefDiag { arg_ty, note: arg.span });
+                    cx.emit_spanned_lint(DROP_REF, 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, note: arg.span });
+                    cx.emit_spanned_lint(FORGET_REF, expr.span, ForgetRefDiag { arg_ty, label: arg.span });
                 },
                 sym::mem_drop if is_copy && !drop_is_single_call_in_arm => {
-                    cx.emit_spanned_lint(DROP_COPY, expr.span, DropCopyDiag { arg_ty, note: arg.span });
+                    cx.emit_spanned_lint(DROP_COPY, expr.span, DropCopyDiag { arg_ty, label: arg.span });
                 }
                 sym::mem_forget if is_copy => {
-                    cx.emit_spanned_lint(FORGET_COPY, expr.span, ForgetCopyDiag { arg_ty, note: arg.span });
+                    cx.emit_spanned_lint(FORGET_COPY, expr.span, ForgetCopyDiag { arg_ty, label: arg.span });
                 }
                 _ => return,
             };
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index 102a149a410..755b907dfe5 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -667,32 +667,32 @@ pub struct ForLoopsOverFalliblesSuggestion<'a> {
 #[diag(lint_drop_ref)]
 pub struct DropRefDiag<'a> {
     pub arg_ty: Ty<'a>,
-    #[note]
-    pub note: Span,
+    #[label]
+    pub label: Span,
 }
 
 #[derive(LintDiagnostic)]
 #[diag(lint_drop_copy)]
 pub struct DropCopyDiag<'a> {
     pub arg_ty: Ty<'a>,
-    #[note]
-    pub note: Span,
+    #[label]
+    pub label: Span,
 }
 
 #[derive(LintDiagnostic)]
 #[diag(lint_forget_ref)]
 pub struct ForgetRefDiag<'a> {
     pub arg_ty: Ty<'a>,
-    #[note]
-    pub note: Span,
+    #[label]
+    pub label: Span,
 }
 
 #[derive(LintDiagnostic)]
 #[diag(lint_forget_copy)]
 pub struct ForgetCopyDiag<'a> {
     pub arg_ty: Ty<'a>,
-    #[note]
-    pub note: Span,
+    #[label]
+    pub label: Span,
 }
 
 // hidden_unicode_codepoints.rs