@@ -9,7 +9,7 @@ use rustc_middle::mir::visit::Visitor as _;
9
9
use rustc_middle:: mir:: { traversal, Body , ConstQualifs , MirPhase , Promoted } ;
10
10
use rustc_middle:: ty:: query:: Providers ;
11
11
use rustc_middle:: ty:: steal:: Steal ;
12
- use rustc_middle:: ty:: { self , InstanceDef , TyCtxt , TypeFoldable } ;
12
+ use rustc_middle:: ty:: { self , TyCtxt , TypeFoldable } ;
13
13
use rustc_span:: { Span , Symbol } ;
14
14
use std:: borrow:: Cow ;
15
15
@@ -49,6 +49,8 @@ pub mod uninhabited_enum_branching;
49
49
pub mod unreachable_prop;
50
50
pub mod validate;
51
51
52
+ pub use rustc_middle:: mir:: MirSource ;
53
+
52
54
pub ( crate ) fn provide ( providers : & mut Providers ) {
53
55
self :: check_unsafety:: provide ( providers) ;
54
56
* providers = Providers {
@@ -132,33 +134,6 @@ fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> FxHashSet<LocalDefId> {
132
134
set
133
135
}
134
136
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
-
162
137
/// Generates a default name for the pass based on the name of the
163
138
/// type `T`.
164
139
pub fn default_name < T : ?Sized > ( ) -> Cow < ' static , str > {
0 commit comments