Do not create move paths that do not need dropping.
This commit is contained in:
parent
f038882fc0
commit
c9c0c0cbca
5 changed files with 64 additions and 60 deletions
|
@ -24,7 +24,8 @@ pub struct RemoveUninitDrops;
|
|||
impl<'tcx> MirPass<'tcx> for RemoveUninitDrops {
|
||||
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
let param_env = tcx.param_env(body.source.def_id());
|
||||
let move_data = MoveData::gather_moves(&body, tcx, param_env, |_| true);
|
||||
let move_data =
|
||||
MoveData::gather_moves(&body, tcx, param_env, |ty| ty.needs_drop(tcx, param_env));
|
||||
|
||||
let mdpe = MoveDataParamEnv { move_data, param_env };
|
||||
let mut maybe_inits = MaybeInitializedPlaces::new(tcx, body, &mdpe)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue