Move MirPatch from rustc_middle to rustc_mir_transform.

Because it's only used in `rustc_mir_transform`. (Presumably it is
currently in `rustc_middle` because lots of other MIR-related stuff is,
but that's not a hard requirement.) And because `rustc_middle` is huge
and it's always good to make it smaller.
This commit is contained in:
Nicholas Nethercote
2025-02-14 15:56:06 +11:00
parent 46c72362bc
commit 28b75a384e
17 changed files with 43 additions and 42 deletions

View File

@@ -6,7 +6,6 @@ use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::lang_items::LangItem;
use rustc_index::{Idx, IndexVec};
use rustc_middle::mir::patch::MirPatch;
use rustc_middle::mir::*;
use rustc_middle::query::Providers;
use rustc_middle::ty::adjustment::PointerCoercion;
@@ -19,6 +18,7 @@ use rustc_span::{DUMMY_SP, Span};
use tracing::{debug, instrument};
use crate::elaborate_drop::{DropElaborator, DropFlagMode, DropStyle, Unwind, elaborate_drop};
use crate::patch::MirPatch;
use crate::{
abort_unwinding_calls, add_call_guards, add_moves_for_packed_drops, deref_separator, inline,
instsimplify, mentioned_items, pass_manager as pm, remove_noop_landing_pads, simplify,