@@ -9,7 +9,7 @@ use rustc_middle::mir::visit::Visitor as _;
99use rustc_middle:: mir:: { traversal, Body , ConstQualifs , MirPhase , Promoted } ;
1010use rustc_middle:: ty:: query:: Providers ;
1111use rustc_middle:: ty:: steal:: Steal ;
12- use rustc_middle:: ty:: { self , InstanceDef , TyCtxt , TypeFoldable } ;
12+ use rustc_middle:: ty:: { self , TyCtxt , TypeFoldable } ;
1313use rustc_span:: { Span , Symbol } ;
1414use std:: borrow:: Cow ;
1515
@@ -49,6 +49,8 @@ pub mod uninhabited_enum_branching;
4949pub mod unreachable_prop;
5050pub mod validate;
5151
52+ pub use rustc_middle:: mir:: MirSource ;
53+
5254pub ( crate ) fn provide ( providers : & mut Providers ) {
5355 self :: check_unsafety:: provide ( providers) ;
5456 * providers = Providers {
@@ -132,33 +134,6 @@ fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> FxHashSet<LocalDefId> {
132134 set
133135}
134136
135- /// Where a specific `mir::Body` comes from.
136- #[ derive( Debug , Copy , Clone ) ]
137- pub struct MirSource < ' tcx > {
138- pub instance : InstanceDef < ' tcx > ,
139-
140- /// If `Some`, this is a promoted rvalue within the parent function.
141- pub promoted : Option < Promoted > ,
142- }
143-
144- impl < ' tcx > MirSource < ' tcx > {
145- pub fn item ( def_id : DefId ) -> Self {
146- MirSource {
147- instance : InstanceDef :: Item ( ty:: WithOptConstParam :: unknown ( def_id) ) ,
148- promoted : None ,
149- }
150- }
151-
152- pub fn with_opt_param ( self ) -> ty:: WithOptConstParam < DefId > {
153- self . instance . with_opt_param ( )
154- }
155-
156- #[ inline]
157- pub fn def_id ( & self ) -> DefId {
158- self . instance . def_id ( )
159- }
160- }
161-
162137/// Generates a default name for the pass based on the name of the
163138/// type `T`.
164139pub fn default_name < T : ?Sized > ( ) -> Cow < ' static , str > {
0 commit comments