mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
98 lines
3.1 KiB
Plaintext
98 lines
3.1 KiB
Plaintext
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
|
--> $DIR/forgetting_references.rs:10:5
|
|
|
|
|
LL | forget(&SomeStruct);
|
|
| ^^^^^^^-----------^
|
|
| |
|
|
| argument has type `&SomeStruct`
|
|
|
|
|
= note: use `let _ = ...` to ignore the expression or result
|
|
note: the lint level is defined here
|
|
--> $DIR/forgetting_references.rs:3:9
|
|
|
|
|
LL | #![warn(forgetting_references)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
|
--> $DIR/forgetting_references.rs:13:5
|
|
|
|
|
LL | forget(&owned);
|
|
| ^^^^^^^------^
|
|
| |
|
|
| 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:14:5
|
|
|
|
|
LL | forget(&&owned);
|
|
| ^^^^^^^-------^
|
|
| |
|
|
| 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:15:5
|
|
|
|
|
LL | forget(&mut owned);
|
|
| ^^^^^^^----------^
|
|
| |
|
|
| argument has type `&mut 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:19:5
|
|
|
|
|
LL | 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:22:5
|
|
|
|
|
LL | forget(reference2);
|
|
| ^^^^^^^----------^
|
|
| |
|
|
| argument has type `&mut 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:25:5
|
|
|
|
|
LL | 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:30:5
|
|
|
|
|
LL | forget(&val);
|
|
| ^^^^^^^----^
|
|
| |
|
|
| argument has type `&T`
|
|
|
|
|
= 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:38:5
|
|
|
|
|
LL | std::mem::forget(&SomeStruct);
|
|
| ^^^^^^^^^^^^^^^^^-----------^
|
|
| |
|
|
| argument has type `&SomeStruct`
|
|
|
|
|
= note: use `let _ = ...` to ignore the expression or result
|
|
|
|
warning: 9 warnings emitted
|
|
|