Skip to content

Commit 1129a71

Browse files
committed
mir: Deaggregate constant MIR
Appears to work now that miri has merged.
1 parent eb2582e commit 1129a71

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

src/librustc_mir/transform/deaggregator.rs

+1-20
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use rustc::hir;
1211
use rustc::ty::TyCtxt;
1312
use rustc::mir::*;
1413
use rustc_data_structures::indexed_vec::Idx;
@@ -19,26 +18,8 @@ pub struct Deaggregator;
1918
impl MirPass for Deaggregator {
2019
fn run_pass<'a, 'tcx>(&self,
2120
tcx: TyCtxt<'a, 'tcx, 'tcx>,
22-
source: MirSource,
21+
_source: MirSource,
2322
mir: &mut Mir<'tcx>) {
24-
// Don't run on constant MIR, because trans might not be able to
25-
// evaluate the modified MIR.
26-
// FIXME(eddyb) Remove check after miri is merged.
27-
let id = tcx.hir.as_local_node_id(source.def_id).unwrap();
28-
match (tcx.hir.body_owner_kind(id), source.promoted) {
29-
(_, Some(_)) |
30-
(hir::BodyOwnerKind::Const, _) |
31-
(hir::BodyOwnerKind::Static(_), _) => return,
32-
33-
(hir::BodyOwnerKind::Fn, _) => {
34-
if tcx.is_const_fn(source.def_id) {
35-
// Don't run on const functions, as, again, trans might not be able to evaluate
36-
// the optimized IR.
37-
return
38-
}
39-
}
40-
}
41-
4223
let (basic_blocks, local_decls) = mir.basic_blocks_and_local_decls_mut();
4324
let local_decls = &*local_decls;
4425
for bb in basic_blocks {

0 commit comments

Comments
 (0)