1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-19 04:48:12 +02:00

Revert "std::mem::drop is in the prelude" (#1031)

Revert "`std::mem::drop` is in the prelude (#1027)"

This reverts commit 5a8bf5624ddd711ff39ff5f13c3e25ae30098e11.
This commit is contained in:
Martin Geisler 2023-07-26 10:31:25 +02:00 committed by GitHub
parent 94ff8548fd
commit b0a9c630f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ fn main() {
Discussion points:
* Why doesn't `Drop::drop` take `self`?
* Short-answer: If it did, `drop` would be called at the end of
* Short-answer: If it did, `std::mem::drop` would be called at the end of
the block, resulting in another call to `Drop::drop`, and a stack
overflow!
* Try replacing `drop(a)` with `a.drop()`.