@@ -39,8 +39,12 @@ LL | forget(s3);
3939 | |
4040 | argument has type `&SomeStruct`
4141 |
42- = note: use `let _ = ...` to ignore the expression or result
4342 = note: `#[warn(forgetting_references)]` on by default
43+ help: use `let _ = ...` to ignore the expression or result
44+ |
45+ LL - forget(s3);
46+ LL + let _ = s3;
47+ |
4448
4549warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
4650 --> $DIR/forgetting_copy_types.rs:37:5
@@ -64,7 +68,11 @@ LL | forget(s5);
6468 | |
6569 | argument has type `&SomeStruct`
6670 |
67- = note: use `let _ = ...` to ignore the expression or result
71+ help: use `let _ = ...` to ignore the expression or result
72+ |
73+ LL - forget(s5);
74+ LL + let _ = s5;
75+ |
6876
6977warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
7078 --> $DIR/forgetting_copy_types.rs:50:5
@@ -74,7 +82,11 @@ LL | forget(a2);
7482 | |
7583 | argument has type `&AnotherStruct`
7684 |
77- = note: use `let _ = ...` to ignore the expression or result
85+ help: use `let _ = ...` to ignore the expression or result
86+ |
87+ LL - forget(a2);
88+ LL + let _ = a2;
89+ |
7890
7991warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
8092 --> $DIR/forgetting_copy_types.rs:52:5
@@ -84,7 +96,11 @@ LL | forget(a3);
8496 | |
8597 | argument has type `&AnotherStruct`
8698 |
87- = note: use `let _ = ...` to ignore the expression or result
99+ help: use `let _ = ...` to ignore the expression or result
100+ |
101+ LL - forget(a3);
102+ LL + let _ = a3;
103+ |
88104
89105warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
90106 --> $DIR/forgetting_copy_types.rs:53:5
@@ -94,7 +110,11 @@ LL | forget(a4);
94110 | |
95111 | argument has type `&AnotherStruct`
96112 |
97- = note: use `let _ = ...` to ignore the expression or result
113+ help: use `let _ = ...` to ignore the expression or result
114+ |
115+ LL - forget(a4);
116+ LL + let _ = a4;
117+ |
98118
99119warning: 8 warnings emitted
100120
0 commit comments