@@ -6,6 +6,7 @@ LL | drop(&SomeStruct);
66 | |
77 | argument has type `&SomeStruct`
88 |
9+ = note: use `let _ = ...` to ignore the expression or result
910note: the lint level is defined here
1011 --> $DIR/drop_ref.rs:3:9
1112 |
@@ -19,6 +20,8 @@ LL | drop(&owned1);
1920 | ^^^^^-------^
2021 | |
2122 | argument has type `&SomeStruct`
23+ |
24+ = note: use `let _ = ...` to ignore the expression or result
2225
2326warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
2427 --> $DIR/drop_ref.rs:12:5
@@ -27,6 +30,8 @@ LL | drop(&&owned1);
2730 | ^^^^^--------^
2831 | |
2932 | argument has type `&&SomeStruct`
33+ |
34+ = note: use `let _ = ...` to ignore the expression or result
3035
3136warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
3237 --> $DIR/drop_ref.rs:13:5
@@ -35,6 +40,8 @@ LL | drop(&mut owned1);
3540 | ^^^^^-----------^
3641 | |
3742 | argument has type `&mut SomeStruct`
43+ |
44+ = note: use `let _ = ...` to ignore the expression or result
3845
3946warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
4047 --> $DIR/drop_ref.rs:17:5
@@ -43,6 +50,8 @@ LL | drop(reference1);
4350 | ^^^^^----------^
4451 | |
4552 | argument has type `&SomeStruct`
53+ |
54+ = note: use `let _ = ...` to ignore the expression or result
4655
4756warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
4857 --> $DIR/drop_ref.rs:20:5
@@ -51,6 +60,8 @@ LL | drop(reference2);
5160 | ^^^^^----------^
5261 | |
5362 | argument has type `&mut SomeStruct`
63+ |
64+ = note: use `let _ = ...` to ignore the expression or result
5465
5566warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
5667 --> $DIR/drop_ref.rs:23:5
@@ -59,6 +70,8 @@ LL | drop(reference3);
5970 | ^^^^^----------^
6071 | |
6172 | argument has type `&SomeStruct`
73+ |
74+ = note: use `let _ = ...` to ignore the expression or result
6275
6376warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
6477 --> $DIR/drop_ref.rs:28:5
@@ -67,6 +80,8 @@ LL | drop(&val);
6780 | ^^^^^----^
6881 | |
6982 | argument has type `&T`
83+ |
84+ = note: use `let _ = ...` to ignore the expression or result
7085
7186warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
7287 --> $DIR/drop_ref.rs:36:5
@@ -75,6 +90,8 @@ LL | std::mem::drop(&SomeStruct);
7590 | ^^^^^^^^^^^^^^^-----------^
7691 | |
7792 | argument has type `&SomeStruct`
93+ |
94+ = note: use `let _ = ...` to ignore the expression or result
7895
7996warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
8097 --> $DIR/drop_ref.rs:91:13
@@ -83,6 +100,8 @@ LL | drop(println_and(&13));
83100 | ^^^^^----------------^
84101 | |
85102 | argument has type `&i32`
103+ |
104+ = note: use `let _ = ...` to ignore the expression or result
86105
87106warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
88107 --> $DIR/drop_ref.rs:94:14
@@ -91,6 +110,8 @@ LL | 3 if drop(println_and(&14)) == () => (),
91110 | ^^^^^----------------^
92111 | |
93112 | argument has type `&i32`
113+ |
114+ = note: use `let _ = ...` to ignore the expression or result
94115
95116warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
96117 --> $DIR/drop_ref.rs:96:14
@@ -99,6 +120,8 @@ LL | 4 => drop(&2),
99120 | ^^^^^--^
100121 | |
101122 | argument has type `&i32`
123+ |
124+ = note: use `let _ = ...` to ignore the expression or result
102125
103126warning: 12 warnings emitted
104127
0 commit comments