about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2021-11-30 15:03:43 -0800
committerDylan MacKenzie <ecstaticmorse@gmail.com>2021-11-30 17:25:30 -0800
commitce2959da97aa98596ee041a3e42d30e50e3f2d7b (patch)
treec3d554ee8c5b7ce33400fb87a3dab16ca6ed518a /compiler/rustc_mir_transform/src
parent4f7605b6fdb81c1f5be62446f56b25a7cbaa8eeb (diff)
downloadrust-ce2959da97aa98596ee041a3e42d30e50e3f2d7b.tar.gz
rust-ce2959da97aa98596ee041a3e42d30e50e3f2d7b.zip
Add rationale for `RemoveUnneededDrops`
...since its name is very close to `RemoveUninitDrops`.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/remove_unneeded_drops.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs b/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs
index c71bc512c31..39f78e9555e 100644
--- a/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs
+++ b/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs
@@ -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::*;