@@ -6,12 +6,16 @@ LL | drop(&SomeStruct);
66 | |
77 | argument has type `&SomeStruct`
88 |
9- = note: use `let _ = ...` to ignore the expression or result
109note: the lint level is defined here
1110 --> $DIR/dropping_references.rs:3:9
1211 |
1312LL | #![warn(dropping_references)]
1413 | ^^^^^^^^^^^^^^^^^^^
14+ help: use `let _ = ...` to ignore the expression or result
15+ |
16+ LL - drop(&SomeStruct);
17+ LL + let _ = &SomeStruct;
18+ |
1519
1620warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
1721 --> $DIR/dropping_references.rs:11:5
@@ -21,7 +25,11 @@ LL | drop(&owned1);
2125 | |
2226 | argument has type `&SomeStruct`
2327 |
24- = note: use `let _ = ...` to ignore the expression or result
28+ help: use `let _ = ...` to ignore the expression or result
29+ |
30+ LL - drop(&owned1);
31+ LL + let _ = &owned1;
32+ |
2533
2634warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
2735 --> $DIR/dropping_references.rs:12:5
@@ -31,7 +39,11 @@ LL | drop(&&owned1);
3139 | |
3240 | argument has type `&&SomeStruct`
3341 |
34- = note: use `let _ = ...` to ignore the expression or result
42+ help: use `let _ = ...` to ignore the expression or result
43+ |
44+ LL - drop(&&owned1);
45+ LL + let _ = &&owned1;
46+ |
3547
3648warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
3749 --> $DIR/dropping_references.rs:13:5
@@ -41,7 +53,11 @@ LL | drop(&mut owned1);
4153 | |
4254 | argument has type `&mut SomeStruct`
4355 |
44- = note: use `let _ = ...` to ignore the expression or result
56+ help: use `let _ = ...` to ignore the expression or result
57+ |
58+ LL - drop(&mut owned1);
59+ LL + let _ = &mut owned1;
60+ |
4561
4662warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
4763 --> $DIR/dropping_references.rs:17:5
@@ -51,7 +67,11 @@ LL | drop(reference1);
5167 | |
5268 | argument has type `&SomeStruct`
5369 |
54- = note: use `let _ = ...` to ignore the expression or result
70+ help: use `let _ = ...` to ignore the expression or result
71+ |
72+ LL - drop(reference1);
73+ LL + let _ = reference1;
74+ |
5575
5676warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
5777 --> $DIR/dropping_references.rs:20:5
@@ -61,7 +81,11 @@ LL | drop(reference2);
6181 | |
6282 | argument has type `&mut SomeStruct`
6383 |
64- = note: use `let _ = ...` to ignore the expression or result
84+ help: use `let _ = ...` to ignore the expression or result
85+ |
86+ LL - drop(reference2);
87+ LL + let _ = reference2;
88+ |
6589
6690warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
6791 --> $DIR/dropping_references.rs:23:5
@@ -71,7 +95,11 @@ LL | drop(reference3);
7195 | |
7296 | argument has type `&SomeStruct`
7397 |
74- = note: use `let _ = ...` to ignore the expression or result
98+ help: use `let _ = ...` to ignore the expression or result
99+ |
100+ LL - drop(reference3);
101+ LL + let _ = reference3;
102+ |
75103
76104warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
77105 --> $DIR/dropping_references.rs:28:5
@@ -81,7 +109,11 @@ LL | drop(&val);
81109 | |
82110 | argument has type `&T`
83111 |
84- = note: use `let _ = ...` to ignore the expression or result
112+ help: use `let _ = ...` to ignore the expression or result
113+ |
114+ LL - drop(&val);
115+ LL + let _ = &val;
116+ |
85117
86118warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
87119 --> $DIR/dropping_references.rs:36:5
@@ -91,7 +123,11 @@ LL | std::mem::drop(&SomeStruct);
91123 | |
92124 | argument has type `&SomeStruct`
93125 |
94- = note: use `let _ = ...` to ignore the expression or result
126+ help: use `let _ = ...` to ignore the expression or result
127+ |
128+ LL - std::mem::drop(&SomeStruct);
129+ LL + let _ = &SomeStruct;
130+ |
95131
96132warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
97133 --> $DIR/dropping_references.rs:91:13
@@ -101,7 +137,11 @@ LL | drop(println_and(&13));
101137 | |
102138 | argument has type `&i32`
103139 |
104- = note: use `let _ = ...` to ignore the expression or result
140+ help: use `let _ = ...` to ignore the expression or result
141+ |
142+ LL - drop(println_and(&13));
143+ LL + let _ = println_and(&13);
144+ |
105145
106146warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
107147 --> $DIR/dropping_references.rs:94:14
0 commit comments