mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-11 07:34:18 +00:00
410 lines
11 KiB
Text
410 lines
11 KiB
Text
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:12:5
|
|
|
|
|
12 | drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/drop_forget_ref.rs:4:9
|
|
|
|
|
4 | #![deny(drop_ref, forget_ref)]
|
|
| ^^^^^^^^
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:12:10
|
|
|
|
|
12 | drop(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:12:5
|
|
|
|
|
12 | drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(drop_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:12:10
|
|
|
|
|
12 | drop(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:13:5
|
|
|
|
|
13 | forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/drop_forget_ref.rs:4:19
|
|
|
|
|
4 | #![deny(drop_ref, forget_ref)]
|
|
| ^^^^^^^^^^
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:13:12
|
|
|
|
|
13 | forget(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:13:5
|
|
|
|
|
13 | forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(forget_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:13:12
|
|
|
|
|
13 | forget(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:16:5
|
|
|
|
|
16 | drop(&owned1);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:16:10
|
|
|
|
|
16 | drop(&owned1);
|
|
| ^^^^^^^
|
|
|
|
warning: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:16:5
|
|
|
|
|
16 | drop(&owned1);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(drop_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:16:10
|
|
|
|
|
16 | drop(&owned1);
|
|
| ^^^^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:17:5
|
|
|
|
|
17 | drop(&&owned1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:17:10
|
|
|
|
|
17 | drop(&&owned1);
|
|
| ^^^^^^^^
|
|
|
|
warning: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:17:5
|
|
|
|
|
17 | drop(&&owned1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(drop_copy)] on by default
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:17:10
|
|
|
|
|
17 | drop(&&owned1);
|
|
| ^^^^^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:18:5
|
|
|
|
|
18 | drop(&mut owned1);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:18:10
|
|
|
|
|
18 | drop(&mut owned1);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:21:5
|
|
|
|
|
21 | forget(&owned2);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:21:12
|
|
|
|
|
21 | forget(&owned2);
|
|
| ^^^^^^^
|
|
|
|
warning: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:21:5
|
|
|
|
|
21 | forget(&owned2);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(forget_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:21:12
|
|
|
|
|
21 | forget(&owned2);
|
|
| ^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:22:5
|
|
|
|
|
22 | forget(&&owned2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:22:12
|
|
|
|
|
22 | forget(&&owned2);
|
|
| ^^^^^^^^
|
|
|
|
warning: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:22:5
|
|
|
|
|
22 | forget(&&owned2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(forget_copy)] on by default
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:22:12
|
|
|
|
|
22 | forget(&&owned2);
|
|
| ^^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:23:5
|
|
|
|
|
23 | forget(&mut owned2);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:23:12
|
|
|
|
|
23 | forget(&mut owned2);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:27:5
|
|
|
|
|
27 | drop(reference1);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:27:10
|
|
|
|
|
27 | drop(reference1);
|
|
| ^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:27:5
|
|
|
|
|
27 | drop(reference1);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(drop_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:27:10
|
|
|
|
|
27 | drop(reference1);
|
|
| ^^^^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:28:5
|
|
|
|
|
28 | forget(&*reference1);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:28:12
|
|
|
|
|
28 | forget(&*reference1);
|
|
| ^^^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:28:5
|
|
|
|
|
28 | forget(&*reference1);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(forget_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:28:12
|
|
|
|
|
28 | forget(&*reference1);
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:31:5
|
|
|
|
|
31 | drop(reference2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:31:10
|
|
|
|
|
31 | drop(reference2);
|
|
| ^^^^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:33:5
|
|
|
|
|
33 | forget(reference3);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:33:12
|
|
|
|
|
33 | forget(reference3);
|
|
| ^^^^^^^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:36:5
|
|
|
|
|
36 | drop(reference4);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:36:10
|
|
|
|
|
36 | drop(reference4);
|
|
| ^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:36:5
|
|
|
|
|
36 | drop(reference4);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(drop_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:36:10
|
|
|
|
|
36 | drop(reference4);
|
|
| ^^^^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:37:5
|
|
|
|
|
37 | forget(reference4);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:37:12
|
|
|
|
|
37 | forget(reference4);
|
|
| ^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:37:5
|
|
|
|
|
37 | forget(reference4);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(forget_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:37:12
|
|
|
|
|
37 | forget(reference4);
|
|
| ^^^^^^^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:42:5
|
|
|
|
|
42 | drop(&val);
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:42:10
|
|
|
|
|
42 | drop(&val);
|
|
| ^^^^
|
|
|
|
warning: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:42:5
|
|
|
|
|
42 | drop(&val);
|
|
| ^^^^^^^^^^
|
|
|
|
|
= note: #[warn(drop_copy)] on by default
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:42:10
|
|
|
|
|
42 | drop(&val);
|
|
| ^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:48:5
|
|
|
|
|
48 | forget(&val);
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:48:12
|
|
|
|
|
48 | forget(&val);
|
|
| ^^^^
|
|
|
|
warning: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:48:5
|
|
|
|
|
48 | forget(&val);
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(forget_copy)] on by default
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:48:12
|
|
|
|
|
48 | forget(&val);
|
|
| ^^^^
|
|
|
|
error: call to `std::mem::drop` with a reference argument. Dropping a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:56:5
|
|
|
|
|
56 | std::mem::drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:56:20
|
|
|
|
|
56 | std::mem::drop(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::drop` with a value that implements Copy. Dropping a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:56:5
|
|
|
|
|
56 | std::mem::drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(drop_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:56:20
|
|
|
|
|
56 | std::mem::drop(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: call to `std::mem::forget` with a reference argument. Forgetting a reference does nothing
|
|
--> $DIR/drop_forget_ref.rs:59:5
|
|
|
|
|
59 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:59:22
|
|
|
|
|
59 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
warning: call to `std::mem::forget` with a value that implements Copy. Forgetting a copy leaves the original intact.
|
|
--> $DIR/drop_forget_ref.rs:59:5
|
|
|
|
|
59 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[warn(forget_copy)] on by default
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:59:22
|
|
|
|
|
59 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: aborting due to 18 previous errors
|
|
|