Skip to content

Commit ce2959d

Browse files
Add rationale for RemoveUnneededDrops
...since its name is very close to `RemoveUninitDrops`.
1 parent 4f7605b commit ce2959d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_mir_transform/src/remove_unneeded_drops.rs

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

0 commit comments

Comments
 (0)