Skip to content

Commit 6d4e204

Browse files
Remove qualify_consts completely
1 parent 55da0c0 commit 6d4e204

File tree

3 files changed

+3
-1488
lines changed

3 files changed

+3
-1488
lines changed

src/librustc_mir/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
3232

3333
#[macro_use] extern crate log;
3434
#[macro_use] extern crate rustc;
35-
#[macro_use] extern crate rustc_data_structures;
3635
#[macro_use] extern crate syntax;
3736

3837
mod borrow_check;

src/librustc_mir/transform/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub mod rustc_peek;
2525
pub mod elaborate_drops;
2626
pub mod add_call_guards;
2727
pub mod promote_consts;
28-
pub mod qualify_consts;
2928
pub mod qualify_min_const_fn;
3029
pub mod remove_noop_landing_pads;
3130
pub mod dump_mir;
@@ -238,18 +237,14 @@ fn mir_validated(
238237
tcx: TyCtxt<'tcx>,
239238
def_id: DefId,
240239
) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
241-
let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
242-
if let hir::BodyOwnerKind::Const = tcx.hir().body_owner_kind(hir_id) {
243-
// Ensure that we compute the `mir_const_qualif` for constants at
244-
// this point, before we steal the mir-const result.
245-
let _ = tcx.mir_const_qualif(def_id);
246-
}
240+
// Ensure that we compute the `mir_const_qualif` for constants at
241+
// this point, before we steal the mir-const result.
242+
let _ = tcx.mir_const_qualif(def_id);
247243

248244
let mut body = tcx.mir_const(def_id).steal();
249245
let promote_pass = promote_consts::PromoteTemps::default();
250246
run_passes(tcx, &mut body, InstanceDef::Item(def_id), None, MirPhase::Validated, &[
251247
// What we need to run borrowck etc.
252-
&qualify_consts::QualifyAndPromoteConstants::default(),
253248
&promote_pass,
254249
&simplify::SimplifyCfg::new("qualify-consts"),
255250
]);

0 commit comments

Comments
 (0)