@@ -107,5 +107,41 @@ note: argument has type `&SomeStruct`
107107LL | std::mem::drop(&SomeStruct);
108108 | ^^^^^^^^^^^
109109
110- error: aborting due to 9 previous errors
110+ error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing
111+ --> $DIR/drop_ref.rs:91:13
112+ |
113+ LL | drop(println_and(&13)); // Lint, even if we only care about the side-effect, it's already in a block
114+ | ^^^^^^^^^^^^^^^^^^^^^^
115+ |
116+ note: argument has type `&i32`
117+ --> $DIR/drop_ref.rs:91:18
118+ |
119+ LL | drop(println_and(&13)); // Lint, even if we only care about the side-effect, it's already in a block
120+ | ^^^^^^^^^^^^^^^^
121+
122+ error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing
123+ --> $DIR/drop_ref.rs:93:14
124+ |
125+ LL | 3 if drop(println_and(&14)) == () => (), // Lint, idiomatic use is only in body of `Arm`
126+ | ^^^^^^^^^^^^^^^^^^^^^^
127+ |
128+ note: argument has type `&i32`
129+ --> $DIR/drop_ref.rs:93:19
130+ |
131+ LL | 3 if drop(println_and(&14)) == () => (), // Lint, idiomatic use is only in body of `Arm`
132+ | ^^^^^^^^^^^^^^^^
133+
134+ error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing
135+ --> $DIR/drop_ref.rs:94:14
136+ |
137+ LL | 4 => drop(&2), // Lint, not a fn/method call
138+ | ^^^^^^^^
139+ |
140+ note: argument has type `&i32`
141+ --> $DIR/drop_ref.rs:94:19
142+ |
143+ LL | 4 => drop(&2), // Lint, not a fn/method call
144+ | ^^
145+
146+ error: aborting due to 12 previous errors
111147
0 commit comments