Skip to content

Commit

Permalink
mir: Run drop elaboration on constant MIR
Browse files Browse the repository at this point in the history
Seems to Just Work since miri merged.
  • Loading branch information
fitzgen committed Apr 27, 2018
1 parent 937f9ba commit eb2582e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/librustc_mir/transform/elaborate_drops.rs
Expand Up @@ -15,7 +15,6 @@ use dataflow::{on_all_children_bits, on_all_drop_children_bits};
use dataflow::{drop_flag_effects_for_location, on_lookup_result_bits};
use dataflow::MoveDataParamEnv;
use dataflow::{self, do_dataflow, DebugFormatted};
use rustc::hir;
use rustc::ty::{self, TyCtxt};
use rustc::mir::*;
use rustc::middle::const_val::ConstVal;
Expand All @@ -42,14 +41,7 @@ impl MirPass for ElaborateDrops {
{
debug!("elaborate_drops({:?} @ {:?})", src, mir.span);

// Don't run on constant MIR, because trans might not be able to
// evaluate the modified MIR.
// FIXME(eddyb) Remove check after miri is merged.
let id = tcx.hir.as_local_node_id(src.def_id).unwrap();
match (tcx.hir.body_owner_kind(id), src.promoted) {
(hir::BodyOwnerKind::Fn, None) => {},
_ => return
}
let param_env = tcx.param_env(src.def_id).with_reveal_all();
let move_data = MoveData::gather_moves(mir, tcx).unwrap();
let elaborate_patch = {
Expand Down

0 comments on commit eb2582e

Please sign in to comment.