@@ -6,12 +6,16 @@ LL | drop(&SomeStruct);
6
6
| |
7
7
| argument has type `&SomeStruct`
8
8
|
9
- = note: use `let _ = ...` to ignore the expression or result
10
9
note: the lint level is defined here
11
10
--> $DIR/dropping_references.rs:3:9
12
11
|
13
12
LL | #![warn(dropping_references)]
14
13
| ^^^^^^^^^^^^^^^^^^^
14
+ help: use `let _ = ...` to ignore the expression or result
15
+ |
16
+ LL - drop(&SomeStruct);
17
+ LL + let _ = &SomeStruct;
18
+ |
15
19
16
20
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
17
21
--> $DIR/dropping_references.rs:11:5
@@ -21,7 +25,11 @@ LL | drop(&owned1);
21
25
| |
22
26
| argument has type `&SomeStruct`
23
27
|
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
+ |
25
33
26
34
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
27
35
--> $DIR/dropping_references.rs:12:5
@@ -31,7 +39,11 @@ LL | drop(&&owned1);
31
39
| |
32
40
| argument has type `&&SomeStruct`
33
41
|
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
+ |
35
47
36
48
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
37
49
--> $DIR/dropping_references.rs:13:5
@@ -41,7 +53,11 @@ LL | drop(&mut owned1);
41
53
| |
42
54
| argument has type `&mut SomeStruct`
43
55
|
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
+ |
45
61
46
62
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
47
63
--> $DIR/dropping_references.rs:17:5
@@ -51,7 +67,11 @@ LL | drop(reference1);
51
67
| |
52
68
| argument has type `&SomeStruct`
53
69
|
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
+ |
55
75
56
76
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
57
77
--> $DIR/dropping_references.rs:20:5
@@ -61,7 +81,11 @@ LL | drop(reference2);
61
81
| |
62
82
| argument has type `&mut SomeStruct`
63
83
|
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
+ |
65
89
66
90
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
67
91
--> $DIR/dropping_references.rs:23:5
@@ -71,7 +95,11 @@ LL | drop(reference3);
71
95
| |
72
96
| argument has type `&SomeStruct`
73
97
|
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
+ |
75
103
76
104
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
77
105
--> $DIR/dropping_references.rs:28:5
@@ -81,7 +109,11 @@ LL | drop(&val);
81
109
| |
82
110
| argument has type `&T`
83
111
|
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
+ |
85
117
86
118
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
87
119
--> $DIR/dropping_references.rs:36:5
@@ -91,7 +123,11 @@ LL | std::mem::drop(&SomeStruct);
91
123
| |
92
124
| argument has type `&SomeStruct`
93
125
|
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
+ |
95
131
96
132
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
97
133
--> $DIR/dropping_references.rs:91:13
@@ -101,7 +137,11 @@ LL | drop(println_and(&13));
101
137
| |
102
138
| argument has type `&i32`
103
139
|
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
+ |
105
145
106
146
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
107
147
--> $DIR/dropping_references.rs:94:14
0 commit comments