summaryrefslogtreecommitdiff
path: root/tests
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 /tests
parent77773ad002f9bd9fc2124b964bebad94b5f5d286 (diff)
downloadrust-457fa953a2ed374630e1f5cd0d8c599c2b4b0609.tar.gz
Use label instead of note to be more consistent with other lints
Diffstat (limited to 'tests')
-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
4 files changed, 117 insertions, 267 deletions
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