Move MirPass to rustc_mir_transform.
Because that's now the only crate that uses it. Moving stuff out of `rustc_middle` is always welcome. I chose to use `impl crate::MirPass`/`impl crate::MirLint` (with explicit `crate::`) everywhere because that's the only mention of `MirPass`/`MirLint` used in all of these files. (Prior to this change, `MirPass` was mostly imported via `use rustc_middle::mir::*` items.)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use rustc_middle::mir::visit::Visitor;
|
||||
use rustc_middle::mir::{self, Location, MentionedItem, MirPass};
|
||||
use rustc_middle::mir::{self, Location, MentionedItem};
|
||||
use rustc_middle::ty::adjustment::PointerCoercion;
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_session::Session;
|
||||
@@ -13,7 +13,7 @@ struct MentionedItemsVisitor<'a, 'tcx> {
|
||||
mentioned_items: &'a mut Vec<Spanned<MentionedItem<'tcx>>>,
|
||||
}
|
||||
|
||||
impl<'tcx> MirPass<'tcx> for MentionedItems {
|
||||
impl<'tcx> crate::MirPass<'tcx> for MentionedItems {
|
||||
fn is_enabled(&self, _sess: &Session) -> bool {
|
||||
// If this pass is skipped the collector assume that nothing got mentioned! We could
|
||||
// potentially skip it in opt-level 0 if we are sure that opt-level will never *remove* uses
|
||||
|
||||
Reference in New Issue
Block a user