rust/tests/ui/lint/forgetting_references.stderr

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

164 lines
4.8 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: the lint level is defined here
--> $DIR/forgetting_references.rs:3:9
2023-03-28 11:31:21 -05:00
|
LL | #![warn(forgetting_references)]
| ^^^^^^^^^^^^^^^^^^^^^
help: use `let _ = ...` to ignore the expression or result
|
LL - forget(&SomeStruct);
LL + let _ = &SomeStruct;
|
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`
|
help: use `let _ = ...` to ignore the expression or result
|
LL - forget(&owned);
LL + let _ = &owned;
|
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`
|
help: use `let _ = ...` to ignore the expression or result
|
LL - forget(&&owned);
LL + let _ = &&owned;
|
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`
|
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
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`
|
help: use `let _ = ...` to ignore the expression or result
|
LL - forget(&*reference1);
LL + let _ = &*reference1;
|
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`
|
help: use `let _ = ...` to ignore the expression or result
|
LL - forget(reference2);
LL + let _ = reference2;
|
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`
|
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`
|
= 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:40:5
2023-03-28 11:31:21 -05:00
|
LL | forget(&val);
| ^^^^^^^----^
| |
| argument has type `&T`
|
help: use `let _ = ...` to ignore the expression or result
|
LL - forget(&val);
LL + let _ = &val;
|
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:48:5
2023-03-28 11:31:21 -05:00
|
LL | std::mem::forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^-----------^
| |
| argument has type `&SomeStruct`
|
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
warning: 12 warnings emitted
2023-03-28 11:31:21 -05:00