rust/tests/ui/lint/forgetting_references.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
3.1 KiB
Plaintext
Raw Normal View History

warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:10:5
2023-03-28 11:31:21 -05:00
|
LL | forget(&SomeStruct);
| ^^^^^^^-----------^
| |
| argument has type `&SomeStruct`
2023-03-28 11:31:21 -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
--> $DIR/forgetting_references.rs:3:9
2023-03-28 11:31:21 -05:00
|
LL | #![warn(forgetting_references)]
| ^^^^^^^^^^^^^^^^^^^^^
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:13:5
2023-03-28 11:31:21 -05:00
|
LL | forget(&owned);
| ^^^^^^^------^
| |
| argument has type `&SomeStruct`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:14:5
2023-03-28 11:31:21 -05:00
|
LL | forget(&&owned);
| ^^^^^^^-------^
| |
| argument has type `&&SomeStruct`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:15:5
2023-03-28 11:31:21 -05:00
|
LL | forget(&mut owned);
| ^^^^^^^----------^
| |
| argument has type `&mut SomeStruct`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:19:5
2023-03-28 11:31:21 -05:00
|
LL | forget(&*reference1);
| ^^^^^^^------------^
| |
| argument has type `&SomeStruct`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:22:5
2023-03-28 11:31:21 -05:00
|
LL | forget(reference2);
| ^^^^^^^----------^
| |
| argument has type `&mut SomeStruct`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:25:5
2023-03-28 11:31:21 -05:00
|
LL | forget(reference3);
| ^^^^^^^----------^
| |
| argument has type `&SomeStruct`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:30:5
2023-03-28 11:31:21 -05:00
|
LL | forget(&val);
| ^^^^^^^----^
| |
| argument has type `&T`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forgetting_references.rs:38:5
2023-03-28 11:31:21 -05:00
|
LL | std::mem::forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^-----------^
| |
| argument has type `&SomeStruct`
|
= note: use `let _ = ...` to ignore the expression or result
2023-03-28 11:31:21 -05:00
warning: 9 warnings emitted