mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
220 lines
6.3 KiB
Text
220 lines
6.3 KiB
Text
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:22:5
|
|
|
|
|
22 | drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::drop-ref` implied by `-D warnings`
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:22:10
|
|
|
|
|
22 | drop(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:23:5
|
|
|
|
|
23 | forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::forget-ref` implied by `-D warnings`
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:23:12
|
|
|
|
|
23 | forget(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:26:5
|
|
|
|
|
26 | drop(&owned1);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:26:10
|
|
|
|
|
26 | drop(&owned1);
|
|
| ^^^^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:27:5
|
|
|
|
|
27 | drop(&&owned1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:27:10
|
|
|
|
|
27 | drop(&&owned1);
|
|
| ^^^^^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:28:5
|
|
|
|
|
28 | drop(&mut owned1);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:28:10
|
|
|
|
|
28 | drop(&mut owned1);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:31:5
|
|
|
|
|
31 | forget(&owned2);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:31:12
|
|
|
|
|
31 | forget(&owned2);
|
|
| ^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:32:5
|
|
|
|
|
32 | forget(&&owned2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:32:12
|
|
|
|
|
32 | forget(&&owned2);
|
|
| ^^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:33:5
|
|
|
|
|
33 | forget(&mut owned2);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:33:12
|
|
|
|
|
33 | forget(&mut owned2);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:37:5
|
|
|
|
|
37 | drop(reference1);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:37:10
|
|
|
|
|
37 | drop(reference1);
|
|
| ^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:38:5
|
|
|
|
|
38 | forget(&*reference1);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:38:12
|
|
|
|
|
38 | forget(&*reference1);
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:41:5
|
|
|
|
|
41 | drop(reference2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:41:10
|
|
|
|
|
41 | drop(reference2);
|
|
| ^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:43:5
|
|
|
|
|
43 | forget(reference3);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:43:12
|
|
|
|
|
43 | forget(reference3);
|
|
| ^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:46:5
|
|
|
|
|
46 | drop(reference4);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:46:10
|
|
|
|
|
46 | drop(reference4);
|
|
| ^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:47:5
|
|
|
|
|
47 | forget(reference4);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:47:12
|
|
|
|
|
47 | forget(reference4);
|
|
| ^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:52:5
|
|
|
|
|
52 | drop(&val);
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:52:10
|
|
|
|
|
52 | drop(&val);
|
|
| ^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:58:5
|
|
|
|
|
58 | forget(&val);
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:58:12
|
|
|
|
|
58 | forget(&val);
|
|
| ^^^^
|
|
|
|
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:66:5
|
|
|
|
|
66 | std::mem::drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:66:20
|
|
|
|
|
66 | std::mem::drop(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
|
--> $DIR/drop_forget_ref.rs:69:5
|
|
|
|
|
69 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:69:22
|
|
|
|
|
69 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: aborting due to 18 previous errors
|
|
|