Add rationale for RemoveUnneededDrops

...since its name is very close to `RemoveUninitDrops`.
This commit is contained in:
Dylan MacKenzie 2021-11-30 15:03:43 -08:00
parent 4f7605b6fd
commit ce2959da97

View File

@ -1,4 +1,8 @@
//! This pass replaces a drop of a type that does not need dropping, with a goto
//! This pass replaces a drop of a type that does not need dropping, with a goto.
//!
//! When the MIR is built, we check `needs_drop` before emitting a `Drop` for a place. This pass is
//! useful because (unlike MIR building) it runs after type checking, so it can make use of
//! `Reveal::All` to provide more precies type information.
use crate::MirPass;
use rustc_middle::mir::*;