@@ -6,6 +6,7 @@ LL | drop(&SomeStruct);
6
6
| |
7
7
| argument has type `&SomeStruct`
8
8
|
9
+ = note: use `let _ = ...` to ignore the expression or result
9
10
note: the lint level is defined here
10
11
--> $DIR/drop_ref.rs:3:9
11
12
|
@@ -19,6 +20,8 @@ LL | drop(&owned1);
19
20
| ^^^^^-------^
20
21
| |
21
22
| argument has type `&SomeStruct`
23
+ |
24
+ = note: use `let _ = ...` to ignore the expression or result
22
25
23
26
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
24
27
--> $DIR/drop_ref.rs:12:5
@@ -27,6 +30,8 @@ LL | drop(&&owned1);
27
30
| ^^^^^--------^
28
31
| |
29
32
| argument has type `&&SomeStruct`
33
+ |
34
+ = note: use `let _ = ...` to ignore the expression or result
30
35
31
36
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
32
37
--> $DIR/drop_ref.rs:13:5
@@ -35,6 +40,8 @@ LL | drop(&mut owned1);
35
40
| ^^^^^-----------^
36
41
| |
37
42
| argument has type `&mut SomeStruct`
43
+ |
44
+ = note: use `let _ = ...` to ignore the expression or result
38
45
39
46
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
40
47
--> $DIR/drop_ref.rs:17:5
@@ -43,6 +50,8 @@ LL | drop(reference1);
43
50
| ^^^^^----------^
44
51
| |
45
52
| argument has type `&SomeStruct`
53
+ |
54
+ = note: use `let _ = ...` to ignore the expression or result
46
55
47
56
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
48
57
--> $DIR/drop_ref.rs:20:5
@@ -51,6 +60,8 @@ LL | drop(reference2);
51
60
| ^^^^^----------^
52
61
| |
53
62
| argument has type `&mut SomeStruct`
63
+ |
64
+ = note: use `let _ = ...` to ignore the expression or result
54
65
55
66
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
56
67
--> $DIR/drop_ref.rs:23:5
@@ -59,6 +70,8 @@ LL | drop(reference3);
59
70
| ^^^^^----------^
60
71
| |
61
72
| argument has type `&SomeStruct`
73
+ |
74
+ = note: use `let _ = ...` to ignore the expression or result
62
75
63
76
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
64
77
--> $DIR/drop_ref.rs:28:5
@@ -67,6 +80,8 @@ LL | drop(&val);
67
80
| ^^^^^----^
68
81
| |
69
82
| argument has type `&T`
83
+ |
84
+ = note: use `let _ = ...` to ignore the expression or result
70
85
71
86
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
72
87
--> $DIR/drop_ref.rs:36:5
@@ -75,6 +90,8 @@ LL | std::mem::drop(&SomeStruct);
75
90
| ^^^^^^^^^^^^^^^-----------^
76
91
| |
77
92
| argument has type `&SomeStruct`
93
+ |
94
+ = note: use `let _ = ...` to ignore the expression or result
78
95
79
96
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
80
97
--> $DIR/drop_ref.rs:91:13
@@ -83,6 +100,8 @@ LL | drop(println_and(&13));
83
100
| ^^^^^----------------^
84
101
| |
85
102
| argument has type `&i32`
103
+ |
104
+ = note: use `let _ = ...` to ignore the expression or result
86
105
87
106
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
88
107
--> $DIR/drop_ref.rs:94:14
@@ -91,6 +110,8 @@ LL | 3 if drop(println_and(&14)) == () => (),
91
110
| ^^^^^----------------^
92
111
| |
93
112
| argument has type `&i32`
113
+ |
114
+ = note: use `let _ = ...` to ignore the expression or result
94
115
95
116
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
96
117
--> $DIR/drop_ref.rs:96:14
@@ -99,6 +120,8 @@ LL | 4 => drop(&2),
99
120
| ^^^^^--^
100
121
| |
101
122
| argument has type `&i32`
123
+ |
124
+ = note: use `let _ = ...` to ignore the expression or result
102
125
103
126
warning: 12 warnings emitted
104
127
0 commit comments