Skip to content

Commit c280afc

Browse files
committed
Remove the rustc_mir::transform entry point for mir-borrowck.
1 parent 4da2a88 commit c280afc

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

src/librustc_driver/driver.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,10 +983,6 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
983983

984984
// borrowck runs between MIR_VALIDATED and MIR_OPTIMIZED.
985985

986-
// FIXME: niko says this should be a query (see rustc::ty::maps)
987-
// instead of a pass.
988-
passes.push_pass(MIR_VALIDATED, mir::transform::borrow_check::BorrowckMir);
989-
990986
// These next passes must be executed together
991987
passes.push_pass(MIR_OPTIMIZED, mir::transform::no_landing_pads::NoLandingPads);
992988
passes.push_pass(MIR_OPTIMIZED, mir::transform::add_call_guards::CriticalCallEdges);

src/librustc_mir/transform/borrow_check.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc::ty::{self, TyCtxt, ParamEnv};
1515
use rustc::mir::{AssertMessage, BasicBlock, BorrowKind, Location, Lvalue};
1616
use rustc::mir::{Mir, Mutability, Operand, Projection, ProjectionElem, Rvalue};
1717
use rustc::mir::{Statement, StatementKind, Terminator, TerminatorKind};
18-
use rustc::mir::transform::{MirPass, MirSource};
18+
use rustc::mir::transform::{MirSource};
1919

2020
use rustc_data_structures::indexed_set::{self, IdxSetBuf};
2121
use rustc_data_structures::indexed_vec::{Idx};
@@ -34,29 +34,6 @@ use util::borrowck_errors::{BorrowckErrors, Origin};
3434
use self::MutateMode::{JustWrite, WriteAndRead};
3535
use self::ConsumeKind::{Consume};
3636

37-
pub struct BorrowckMir;
38-
39-
impl MirPass for BorrowckMir {
40-
fn run_pass<'a, 'tcx>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, src: MirSource, mir: &mut Mir<'tcx>) {
41-
42-
// let err_count = tcx.sess.err_count();
43-
// if err_count > 0 {
44-
// // compiling a broken program can obviously result in a
45-
// // broken MIR, so try not to report duplicate errors.
46-
// debug!("skipping BorrowckMir: {} due to {} previous errors",
47-
// tcx.node_path_str(src.item_id()), err_count);
48-
// return;
49-
// }
50-
51-
debug!("run_pass BorrowckMir: {}", tcx.node_path_str(src.item_id()));
52-
53-
let def_id = tcx.hir.local_def_id(src.item_id());
54-
if tcx.has_attr(def_id, "rustc_mir_borrowck") || tcx.sess.opts.debugging_opts.borrowck_mir {
55-
borrowck_mir(tcx, src, mir);
56-
}
57-
}
58-
}
59-
6037
pub(crate) fn borrowck_mir<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, src: MirSource, mir: &Mir<'tcx>)
6138
{
6239
let id = src.item_id();

0 commit comments

Comments
 (0)