2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:10:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(&SomeStruct);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^-----------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:3:9
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
2023-05-19 04:30:11 -05:00
|
|
|
LL | #![warn(forgetting_references)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(&SomeStruct);
|
|
|
|
LL + let _ = &SomeStruct;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:13:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(&owned);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(&owned);
|
|
|
|
LL + let _ = &owned;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:14:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(&&owned);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^-------^
|
|
|
|
| |
|
|
|
|
| argument has type `&&SomeStruct`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(&&owned);
|
|
|
|
LL + let _ = &&owned;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:15:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(&mut owned);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^----------^
|
|
|
|
| |
|
|
|
|
| argument has type `&mut SomeStruct`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(&mut owned);
|
|
|
|
LL + let _ = &mut owned;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:19:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(&*reference1);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^------------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(&*reference1);
|
|
|
|
LL + let _ = &*reference1;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:22:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(reference2);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^----------^
|
|
|
|
| |
|
|
|
|
| argument has type `&mut SomeStruct`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(reference2);
|
|
|
|
LL + let _ = reference2;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:25:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(reference3);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^----------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(reference3);
|
|
|
|
LL + let _ = reference3;
|
|
|
|
|
|
|
|
|
|
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
|
|
|
--> $DIR/forgetting_references.rs:31:14
|
|
|
|
|
|
|
|
|
LL | 1 => forget(&*reference1),
|
|
|
|
| ^^^^^^^------------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
|
|
|
|
|
|
|
|
= note: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
|
|
|
--> $DIR/forgetting_references.rs:32:14
|
|
|
|
|
|
|
|
|
LL | 2 => forget(reference3),
|
|
|
|
| ^^^^^^^----------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
|
|
|
|
|
|
|
|
= note: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
|
|
|
--> $DIR/forgetting_references.rs:33:14
|
|
|
|
|
|
|
|
|
LL | 3 => forget(reference4),
|
|
|
|
| ^^^^^^^----------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
|
|
|
|
|
2023-04-14 15:20:27 -05:00
|
|
|
= note: use `let _ = ...` to ignore the expression or result
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2024-05-24 22:44:14 -05:00
|
|
|
--> $DIR/forgetting_references.rs:40:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | forget(&val);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^----^
|
|
|
|
| |
|
|
|
|
| argument has type `&T`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - forget(&val);
|
|
|
|
LL + let _ = &val;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2023-04-14 14:49:05 -05:00
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
2024-05-24 22:44:14 -05:00
|
|
|
--> $DIR/forgetting_references.rs:48:5
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
|
LL | std::mem::forget(&SomeStruct);
|
2023-04-10 04:55:37 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^-----------^
|
|
|
|
| |
|
|
|
|
| argument has type `&SomeStruct`
|
2023-04-14 15:20:27 -05:00
|
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
help: use `let _ = ...` to ignore the expression or result
|
|
|
|
|
|
|
|
|
LL - std::mem::forget(&SomeStruct);
|
|
|
|
LL + let _ = &SomeStruct;
|
|
|
|
|
|
2023-03-28 11:31:21 -05:00
|
|
|
|
2024-05-24 22:44:14 -05:00
|
|
|
warning: 12 warnings emitted
|
2023-03-28 11:31:21 -05:00
|
|
|
|