88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- use rustc:: hir;
1211use rustc:: ty:: TyCtxt ;
1312use rustc:: mir:: * ;
1413use rustc_data_structures:: indexed_vec:: Idx ;
@@ -19,26 +18,8 @@ pub struct Deaggregator;
1918impl 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