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
|
|
|
|
|
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
|
|
|
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)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
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
|
|
|
|
|
|
|
|
= 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
|
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
|
|
|
|
|
|
|
|
= 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
|
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
|
|
|
|
|
|
|
|
= 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
|
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
|
|
|
|
|
|
|
|
= 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
|
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
|
|
|
|
|
|
|
|
= 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
|
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
|
|
|
|
|
|
|
|
= 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
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:30: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
|
|
|
|
|
|
|
|
= 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
|
2023-05-19 04:30:11 -05:00
|
|
|
--> $DIR/forgetting_references.rs:38: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
|
|
|
|
|
|
|
|
= note: use `let _ = ...` to ignore the expression or result
|
2023-03-28 11:31:21 -05:00
|
|
|
|
|
|
|
warning: 9 warnings emitted
|
|
|
|
|