Skip to main content

Module remove_unneeded_drops

Module remove_unneeded_drops 

Source
Expand description

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 TypingMode::PostAnalysis to provide more precise type information, especially about opaque types.

Re-exportsยง

use rustc_middle::ty::TyCtxt; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::trace; ๐Ÿ”’
use super::simplify::simplify_cfg; ๐Ÿ”’
use crate::PassPolicy; ๐Ÿ”’
use rustc_middle::mir::*; ๐Ÿ”’

Structsยง

RemoveUnneededDrops ๐Ÿ”’