|
1 | 1 | #![feature(box_patterns)] |
2 | 2 | #![feature(box_syntax)] |
| 3 | +#![feature(const_fn_trait_bound)] |
| 4 | +#![feature(const_mut_refs)] |
| 5 | +#![feature(const_range_bounds)] |
| 6 | +#![feature(const_trait_impl)] |
| 7 | +#![feature(const_type_id)] |
| 8 | +#![feature(const_type_id_cmp)] |
3 | 9 | #![feature(crate_visibility_modifier)] |
4 | 10 | #![feature(in_band_lifetimes)] |
5 | 11 | #![feature(iter_zip)] |
@@ -32,6 +38,11 @@ use rustc_middle::ty::query::Providers; |
32 | 38 | use rustc_middle::ty::{self, TyCtxt, TypeFoldable}; |
33 | 39 | use rustc_span::{Span, Symbol}; |
34 | 40 |
|
| 41 | +use self::pass_manager::{Lint, MirPassC}; |
| 42 | + |
| 43 | +#[macro_use] |
| 44 | +mod pass_manager; |
| 45 | + |
35 | 46 | mod abort_unwinding_calls; |
36 | 47 | mod add_call_guards; |
37 | 48 | mod add_moves_for_packed_drops; |
@@ -316,17 +327,11 @@ fn mir_promoted( |
316 | 327 | } |
317 | 328 | body.required_consts = required_consts; |
318 | 329 |
|
319 | | - let promote_pass = promote_consts::PromoteTemps::default(); |
320 | | - let promote: &[&dyn MirPass<'tcx>] = &[ |
321 | | - // What we need to run borrowck etc. |
322 | | - &promote_pass, |
323 | | - &simplify::SimplifyCfg::new("promote-consts"), |
324 | | - ]; |
325 | | - |
326 | | - let opt_coverage: &[&dyn MirPass<'tcx>] = |
327 | | - if tcx.sess.instrument_coverage() { &[&coverage::InstrumentCoverage] } else { &[] }; |
328 | | - |
329 | | - run_passes(tcx, &mut body, MirPhase::ConstPromotion, &[promote, opt_coverage]); |
| 330 | + run_passes!(tcx, &mut body, [ |
| 331 | + promote_consts::PromoteTemps, |
| 332 | + simplify::SimplifyCfg::new("promote-consts"), |
| 333 | + coverage::InstrumentCoverage, |
| 334 | + ]); |
330 | 335 |
|
331 | 336 | let promoted = std::mem::take(&mut body.promoted_fragments); |
332 | 337 | (tcx.alloc_steal_mir(body), tcx.alloc_steal_promoted(promoted)) |
|
0 commit comments