8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- use rustc:: hir;
12
11
use rustc:: ty:: TyCtxt ;
13
12
use rustc:: mir:: * ;
14
13
use rustc_data_structures:: indexed_vec:: Idx ;
@@ -19,26 +18,8 @@ pub struct Deaggregator;
19
18
impl MirPass for Deaggregator {
20
19
fn run_pass < ' a , ' tcx > ( & self ,
21
20
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
22
- source : MirSource ,
21
+ _source : MirSource ,
23
22
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
-
42
23
let ( basic_blocks, local_decls) = mir. basic_blocks_and_local_decls_mut ( ) ;
43
24
let local_decls = & * local_decls;
44
25
for bb in basic_blocks {
0 commit comments