mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 09:03:18 +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:18:5
|
|
|
|
|
18 | drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::drop-ref` implied by `-D warnings`
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:18:10
|
|
|
|
|
18 | 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:19:5
|
|
|
|
|
19 | forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::forget-ref` implied by `-D warnings`
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:19:12
|
|
|
|
|
19 | 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:22:5
|
|
|
|
|
22 | drop(&owned1);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:22:10
|
|
|
|
|
22 | 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:23:5
|
|
|
|
|
23 | drop(&&owned1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:23:10
|
|
|
|
|
23 | 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:24:5
|
|
|
|
|
24 | drop(&mut owned1);
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:24:10
|
|
|
|
|
24 | 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:27:5
|
|
|
|
|
27 | forget(&owned2);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:27:12
|
|
|
|
|
27 | 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:28:5
|
|
|
|
|
28 | forget(&&owned2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &&SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:28:12
|
|
|
|
|
28 | 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:29:5
|
|
|
|
|
29 | forget(&mut owned2);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:29:12
|
|
|
|
|
29 | 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:33:5
|
|
|
|
|
33 | drop(reference1);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:33:10
|
|
|
|
|
33 | 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:34:5
|
|
|
|
|
34 | forget(&*reference1);
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:34:12
|
|
|
|
|
34 | 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:37:5
|
|
|
|
|
37 | drop(reference2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:37:10
|
|
|
|
|
37 | 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:39:5
|
|
|
|
|
39 | forget(reference3);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &mut SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:39:12
|
|
|
|
|
39 | 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:42:5
|
|
|
|
|
42 | drop(reference4);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:42:10
|
|
|
|
|
42 | 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:43:5
|
|
|
|
|
43 | forget(reference4);
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:43:12
|
|
|
|
|
43 | 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:48:5
|
|
|
|
|
48 | drop(&val);
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:48:10
|
|
|
|
|
48 | 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:54:5
|
|
|
|
|
54 | forget(&val);
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &T
|
|
--> $DIR/drop_forget_ref.rs:54:12
|
|
|
|
|
54 | 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:62:5
|
|
|
|
|
62 | std::mem::drop(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:62:20
|
|
|
|
|
62 | 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:65:5
|
|
|
|
|
65 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: argument has type &SomeStruct
|
|
--> $DIR/drop_forget_ref.rs:65:22
|
|
|
|
|
65 | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^
|
|
|
|
error: aborting due to 18 previous errors
|
|
|