about summary refs log tree commit diff
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
parent77773ad002f9bd9fc2124b964bebad94b5f5d286 (diff)
downloadrust-457fa953a2ed374630e1f5cd0d8c599c2b4b0609.tar.gz
rust-457fa953a2ed374630e1f5cd0d8c599c2b4b0609.zip
Use label instead of note to be more consistent with other lints
-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
-rw-r--r--tests/ui/lint/drop_copy.stderr98
-rw-r--r--tests/ui/lint/drop_ref.stderr119
-rw-r--r--tests/ui/lint/forget_copy.stderr78
-rw-r--r--tests/ui/lint/forget_ref.stderr89
7 files changed, 133 insertions, 283 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
diff --git a/tests/ui/lint/drop_copy.stderr b/tests/ui/lint/drop_copy.stderr
index 03d0b392e2b..a7a3b0e25ec 100644
--- a/tests/ui/lint/drop_copy.stderr
+++ b/tests/ui/lint/drop_copy.stderr
@@ -2,13 +2,10 @@ warning: calls to `std::mem::drop` with a value that implements `Copy`.
   --> $DIR/drop_copy.rs:34:5
    |
 LL |     drop(s1);
-   |     ^^^^^^^^
+   |     ^^^^^--^
+   |          |
+   |          argument has type `SomeStruct`
    |
-note: argument has type `SomeStruct`
-  --> $DIR/drop_copy.rs:34:10
-   |
-LL |     drop(s1);
-   |          ^^
 note: the lint level is defined here
   --> $DIR/drop_copy.rs:3:9
    |
@@ -19,110 +16,75 @@ warning: calls to `std::mem::drop` with a value that implements `Copy`.
   --> $DIR/drop_copy.rs:35:5
    |
 LL |     drop(s2);
-   |     ^^^^^^^^
-   |
-note: argument has type `SomeStruct`
-  --> $DIR/drop_copy.rs:35:10
-   |
-LL |     drop(s2);
-   |          ^^
+   |     ^^^^^--^
+   |          |
+   |          argument has type `SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_copy.rs:36:5
    |
 LL |     drop(s3);
-   |     ^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/drop_copy.rs:36:10
+   |     ^^^^^--^
+   |          |
+   |          argument has type `&SomeStruct`
    |
-LL |     drop(s3);
-   |          ^^
    = note: `#[warn(drop_ref)]` on by default
 
 warning: calls to `std::mem::drop` with a value that implements `Copy`.
   --> $DIR/drop_copy.rs:37:5
    |
 LL |     drop(s4);
-   |     ^^^^^^^^
-   |
-note: argument has type `SomeStruct`
-  --> $DIR/drop_copy.rs:37:10
-   |
-LL |     drop(s4);
-   |          ^^
+   |     ^^^^^--^
+   |          |
+   |          argument has type `SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_copy.rs:38:5
    |
 LL |     drop(s5);
-   |     ^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/drop_copy.rs:38:10
-   |
-LL |     drop(s5);
-   |          ^^
+   |     ^^^^^--^
+   |          |
+   |          argument has type `&SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_copy.rs:50:5
    |
 LL |     drop(a2);
-   |     ^^^^^^^^
-   |
-note: argument has type `&AnotherStruct`
-  --> $DIR/drop_copy.rs:50:10
-   |
-LL |     drop(a2);
-   |          ^^
+   |     ^^^^^--^
+   |          |
+   |          argument has type `&AnotherStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_copy.rs:52:5
    |
 LL |     drop(a4);
-   |     ^^^^^^^^
-   |
-note: argument has type `&AnotherStruct`
-  --> $DIR/drop_copy.rs:52:10
-   |
-LL |     drop(a4);
-   |          ^^
+   |     ^^^^^--^
+   |          |
+   |          argument has type `&AnotherStruct`
 
 warning: calls to `std::mem::drop` with a value that implements `Copy`.
   --> $DIR/drop_copy.rs:71:13
    |
 LL |             drop(println_and(13));
-   |             ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `i32`
-  --> $DIR/drop_copy.rs:71:18
-   |
-LL |             drop(println_and(13));
-   |                  ^^^^^^^^^^^^^^^
+   |             ^^^^^---------------^
+   |                  |
+   |                  argument has type `i32`
 
 warning: calls to `std::mem::drop` with a value that implements `Copy`.
   --> $DIR/drop_copy.rs:74:14
    |
 LL |         3 if drop(println_and(14)) == () => (),
-   |              ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `i32`
-  --> $DIR/drop_copy.rs:74:19
-   |
-LL |         3 if drop(println_and(14)) == () => (),
-   |                   ^^^^^^^^^^^^^^^
+   |              ^^^^^---------------^
+   |                   |
+   |                   argument has type `i32`
 
 warning: calls to `std::mem::drop` with a value that implements `Copy`.
   --> $DIR/drop_copy.rs:76:14
    |
 LL |         4 => drop(2),
-   |              ^^^^^^^
-   |
-note: argument has type `i32`
-  --> $DIR/drop_copy.rs:76:19
-   |
-LL |         4 => drop(2),
-   |                   ^
+   |              ^^^^^-^
+   |                   |
+   |                   argument has type `i32`
 
 warning: 10 warnings emitted
 
diff --git a/tests/ui/lint/drop_ref.stderr b/tests/ui/lint/drop_ref.stderr
index 34e4050abcf..c701f99fa90 100644
--- a/tests/ui/lint/drop_ref.stderr
+++ b/tests/ui/lint/drop_ref.stderr
@@ -2,13 +2,10 @@ warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:8:5
    |
 LL |     drop(&SomeStruct);
-   |     ^^^^^^^^^^^^^^^^^
+   |     ^^^^^-----------^
+   |          |
+   |          argument has type `&SomeStruct`
    |
-note: argument has type `&SomeStruct`
-  --> $DIR/drop_ref.rs:8:10
-   |
-LL |     drop(&SomeStruct);
-   |          ^^^^^^^^^^^
 note: the lint level is defined here
   --> $DIR/drop_ref.rs:3:9
    |
@@ -19,133 +16,89 @@ warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:11:5
    |
 LL |     drop(&owned1);
-   |     ^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/drop_ref.rs:11:10
-   |
-LL |     drop(&owned1);
-   |          ^^^^^^^
+   |     ^^^^^-------^
+   |          |
+   |          argument has type `&SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:12:5
    |
 LL |     drop(&&owned1);
-   |     ^^^^^^^^^^^^^^
-   |
-note: argument has type `&&SomeStruct`
-  --> $DIR/drop_ref.rs:12:10
-   |
-LL |     drop(&&owned1);
-   |          ^^^^^^^^
+   |     ^^^^^--------^
+   |          |
+   |          argument has type `&&SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:13:5
    |
 LL |     drop(&mut owned1);
-   |     ^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&mut SomeStruct`
-  --> $DIR/drop_ref.rs:13:10
-   |
-LL |     drop(&mut owned1);
-   |          ^^^^^^^^^^^
+   |     ^^^^^-----------^
+   |          |
+   |          argument has type `&mut SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:17:5
    |
 LL |     drop(reference1);
-   |     ^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/drop_ref.rs:17:10
-   |
-LL |     drop(reference1);
-   |          ^^^^^^^^^^
+   |     ^^^^^----------^
+   |          |
+   |          argument has type `&SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:20:5
    |
 LL |     drop(reference2);
-   |     ^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&mut SomeStruct`
-  --> $DIR/drop_ref.rs:20:10
-   |
-LL |     drop(reference2);
-   |          ^^^^^^^^^^
+   |     ^^^^^----------^
+   |          |
+   |          argument has type `&mut SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:23:5
    |
 LL |     drop(reference3);
-   |     ^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/drop_ref.rs:23:10
-   |
-LL |     drop(reference3);
-   |          ^^^^^^^^^^
+   |     ^^^^^----------^
+   |          |
+   |          argument has type `&SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:28:5
    |
 LL |     drop(&val);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `&T`
-  --> $DIR/drop_ref.rs:28:10
-   |
-LL |     drop(&val);
-   |          ^^^^
+   |     ^^^^^----^
+   |          |
+   |          argument has type `&T`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:36:5
    |
 LL |     std::mem::drop(&SomeStruct);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/drop_ref.rs:36:20
-   |
-LL |     std::mem::drop(&SomeStruct);
-   |                    ^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^-----------^
+   |                    |
+   |                    argument has type `&SomeStruct`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:91:13
    |
 LL |             drop(println_and(&13));
-   |             ^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&i32`
-  --> $DIR/drop_ref.rs:91:18
-   |
-LL |             drop(println_and(&13));
-   |                  ^^^^^^^^^^^^^^^^
+   |             ^^^^^----------------^
+   |                  |
+   |                  argument has type `&i32`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:94:14
    |
 LL |         3 if drop(println_and(&14)) == () => (),
-   |              ^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&i32`
-  --> $DIR/drop_ref.rs:94:19
-   |
-LL |         3 if drop(println_and(&14)) == () => (),
-   |                   ^^^^^^^^^^^^^^^^
+   |              ^^^^^----------------^
+   |                   |
+   |                   argument has type `&i32`
 
 warning: calls to `std::mem::drop` with a reference instead of an owned value
   --> $DIR/drop_ref.rs:96:14
    |
 LL |         4 => drop(&2),
-   |              ^^^^^^^^
-   |
-note: argument has type `&i32`
-  --> $DIR/drop_ref.rs:96:19
-   |
-LL |         4 => drop(&2),
-   |                   ^^
+   |              ^^^^^--^
+   |                   |
+   |                   argument has type `&i32`
 
 warning: 12 warnings emitted
 
diff --git a/tests/ui/lint/forget_copy.stderr b/tests/ui/lint/forget_copy.stderr
index d33dfa0fd3d..e2fc0f8af4f 100644
--- a/tests/ui/lint/forget_copy.stderr
+++ b/tests/ui/lint/forget_copy.stderr
@@ -2,13 +2,10 @@ warning: calls to `std::mem::forget` with a value that implements `Copy`.
   --> $DIR/forget_copy.rs:34:5
    |
 LL |     forget(s1);
-   |     ^^^^^^^^^^
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `SomeStruct`
    |
-note: argument has type `SomeStruct`
-  --> $DIR/forget_copy.rs:34:12
-   |
-LL |     forget(s1);
-   |            ^^
 note: the lint level is defined here
   --> $DIR/forget_copy.rs:3:9
    |
@@ -19,86 +16,59 @@ warning: calls to `std::mem::forget` with a value that implements `Copy`.
   --> $DIR/forget_copy.rs:35:5
    |
 LL |     forget(s2);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `SomeStruct`
-  --> $DIR/forget_copy.rs:35:12
-   |
-LL |     forget(s2);
-   |            ^^
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_copy.rs:36:5
    |
 LL |     forget(s3);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/forget_copy.rs:36:12
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `&SomeStruct`
    |
-LL |     forget(s3);
-   |            ^^
    = note: `#[warn(forget_ref)]` on by default
 
 warning: calls to `std::mem::forget` with a value that implements `Copy`.
   --> $DIR/forget_copy.rs:37:5
    |
 LL |     forget(s4);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `SomeStruct`
-  --> $DIR/forget_copy.rs:37:12
-   |
-LL |     forget(s4);
-   |            ^^
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_copy.rs:38:5
    |
 LL |     forget(s5);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/forget_copy.rs:38:12
-   |
-LL |     forget(s5);
-   |            ^^
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `&SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_copy.rs:50:5
    |
 LL |     forget(a2);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `&AnotherStruct`
-  --> $DIR/forget_copy.rs:50:12
-   |
-LL |     forget(a2);
-   |            ^^
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `&AnotherStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_copy.rs:52:5
    |
 LL |     forget(a3);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `&AnotherStruct`
-  --> $DIR/forget_copy.rs:52:12
-   |
-LL |     forget(a3);
-   |            ^^
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `&AnotherStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_copy.rs:53:5
    |
 LL |     forget(a4);
-   |     ^^^^^^^^^^
-   |
-note: argument has type `&AnotherStruct`
-  --> $DIR/forget_copy.rs:53:12
-   |
-LL |     forget(a4);
-   |            ^^
+   |     ^^^^^^^--^
+   |            |
+   |            argument has type `&AnotherStruct`
 
 warning: 8 warnings emitted
 
diff --git a/tests/ui/lint/forget_ref.stderr b/tests/ui/lint/forget_ref.stderr
index abb45443e4e..96fb217215a 100644
--- a/tests/ui/lint/forget_ref.stderr
+++ b/tests/ui/lint/forget_ref.stderr
@@ -2,13 +2,10 @@ warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:10:5
    |
 LL |     forget(&SomeStruct);
-   |     ^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^-----------^
+   |            |
+   |            argument has type `&SomeStruct`
    |
-note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:10:12
-   |
-LL |     forget(&SomeStruct);
-   |            ^^^^^^^^^^^
 note: the lint level is defined here
   --> $DIR/forget_ref.rs:3:9
    |
@@ -19,97 +16,65 @@ warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:13:5
    |
 LL |     forget(&owned);
-   |     ^^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:13:12
-   |
-LL |     forget(&owned);
-   |            ^^^^^^
+   |     ^^^^^^^------^
+   |            |
+   |            argument has type `&SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:14:5
    |
 LL |     forget(&&owned);
-   |     ^^^^^^^^^^^^^^^
-   |
-note: argument has type `&&SomeStruct`
-  --> $DIR/forget_ref.rs:14:12
-   |
-LL |     forget(&&owned);
-   |            ^^^^^^^
+   |     ^^^^^^^-------^
+   |            |
+   |            argument has type `&&SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:15:5
    |
 LL |     forget(&mut owned);
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&mut SomeStruct`
-  --> $DIR/forget_ref.rs:15:12
-   |
-LL |     forget(&mut owned);
-   |            ^^^^^^^^^^
+   |     ^^^^^^^----------^
+   |            |
+   |            argument has type `&mut SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:19:5
    |
 LL |     forget(&*reference1);
-   |     ^^^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:19:12
-   |
-LL |     forget(&*reference1);
-   |            ^^^^^^^^^^^^
+   |     ^^^^^^^------------^
+   |            |
+   |            argument has type `&SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:22:5
    |
 LL |     forget(reference2);
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&mut SomeStruct`
-  --> $DIR/forget_ref.rs:22:12
-   |
-LL |     forget(reference2);
-   |            ^^^^^^^^^^
+   |     ^^^^^^^----------^
+   |            |
+   |            argument has type `&mut SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:25:5
    |
 LL |     forget(reference3);
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:25:12
-   |
-LL |     forget(reference3);
-   |            ^^^^^^^^^^
+   |     ^^^^^^^----------^
+   |            |
+   |            argument has type `&SomeStruct`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:30:5
    |
 LL |     forget(&val);
-   |     ^^^^^^^^^^^^
-   |
-note: argument has type `&T`
-  --> $DIR/forget_ref.rs:30:12
-   |
-LL |     forget(&val);
-   |            ^^^^
+   |     ^^^^^^^----^
+   |            |
+   |            argument has type `&T`
 
 warning: calls to `std::mem::forget` with a reference instead of an owned value
   --> $DIR/forget_ref.rs:38:5
    |
 LL |     std::mem::forget(&SomeStruct);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: argument has type `&SomeStruct`
-  --> $DIR/forget_ref.rs:38:22
-   |
-LL |     std::mem::forget(&SomeStruct);
-   |                      ^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^-----------^
+   |                      |
+   |                      argument has type `&SomeStruct`
 
 warning: 9 warnings emitted