@@ -9,7 +9,7 @@ use rustc_index::IndexVec;
9
9
use rustc_lint:: LateContext ;
10
10
use rustc_middle:: mir;
11
11
use rustc_middle:: mir:: { BasicBlock , Local , Place } ;
12
- use rustc_middle:: ty:: TyCtxt ;
12
+ use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
13
13
use rustc_span:: Symbol ;
14
14
use smallvec:: SmallVec ;
15
15
@@ -24,14 +24,9 @@ pub struct AnalysisInfo<'tcx> {
24
24
pub tcx : TyCtxt < ' tcx > ,
25
25
pub body : & ' tcx mir:: Body < ' tcx > ,
26
26
pub def_id : LocalDefId ,
27
- // borrow_set: Rc<borrowck::BorrowSet<'tcx>>,
28
- // locs: FxIndexMap<Location, Vec<BorrowIndex>>
29
27
pub cfg : IndexVec < BasicBlock , CfgInfo > ,
30
28
/// The set defines the loop bbs, and the basic block determines the end of the loop
31
29
pub terms : FxHashMap < BasicBlock , FxHashMap < Local , Vec < Local > > > ,
32
- /// The final block that contains the return.
33
- pub return_block : BasicBlock ,
34
- // FIXME: This should be a IndexVec
35
30
pub locals : IndexVec < Local , LocalInfo < ' tcx > > ,
36
31
pub preds : IndexVec < BasicBlock , SmallVec < [ BasicBlock ; 1 ] > > ,
37
32
pub preds_unlooped : IndexVec < BasicBlock , SmallVec < [ BasicBlock ; 1 ] > > ,
@@ -69,7 +64,6 @@ impl<'tcx> AnalysisInfo<'tcx> {
69
64
let MetaAnalysis {
70
65
cfg,
71
66
terms,
72
- return_block,
73
67
locals,
74
68
preds,
75
69
preds_unlooped,
@@ -88,7 +82,6 @@ impl<'tcx> AnalysisInfo<'tcx> {
88
82
def_id,
89
83
cfg,
90
84
terms,
91
- return_block,
92
85
locals,
93
86
preds,
94
87
preds_unlooped,
@@ -246,44 +239,39 @@ pub enum SimpleTyKind {
246
239
}
247
240
248
241
impl SimpleTyKind {
249
- pub fn from_ty ( ty : rustc_middle :: ty :: Ty < ' _ > ) -> Self {
242
+ pub fn from_ty ( ty : Ty < ' _ > ) -> Self {
250
243
match ty. kind ( ) {
251
- rustc_middle :: ty :: TyKind :: Tuple ( tys) if tys. is_empty ( ) => SimpleTyKind :: Unit ,
252
- rustc_middle :: ty :: TyKind :: Tuple ( _) => SimpleTyKind :: Tuple ,
244
+ ty :: Tuple ( tys) if tys. is_empty ( ) => SimpleTyKind :: Unit ,
245
+ ty :: Tuple ( _) => SimpleTyKind :: Tuple ,
253
246
254
- rustc_middle :: ty :: TyKind :: Never => SimpleTyKind :: Never ,
247
+ ty :: Never => SimpleTyKind :: Never ,
255
248
256
- rustc_middle:: ty:: TyKind :: Bool
257
- | rustc_middle:: ty:: TyKind :: Char
258
- | rustc_middle:: ty:: TyKind :: Int ( _)
259
- | rustc_middle:: ty:: TyKind :: Uint ( _)
260
- | rustc_middle:: ty:: TyKind :: Float ( _)
261
- | rustc_middle:: ty:: TyKind :: Str => SimpleTyKind :: Primitive ,
249
+ ty:: Bool | ty:: Char | ty:: Int ( _) | ty:: Uint ( _) | ty:: Float ( _) | ty:: Str => SimpleTyKind :: Primitive ,
262
250
263
- rustc_middle :: ty :: TyKind :: Adt ( _, _) => SimpleTyKind :: UserDef ,
251
+ ty :: Adt ( _, _) => SimpleTyKind :: UserDef ,
264
252
265
- rustc_middle :: ty:: TyKind :: Array ( _, _) | rustc_middle :: ty :: TyKind :: Slice ( _) => SimpleTyKind :: Sequence ,
253
+ ty:: Array ( _, _) | ty :: Slice ( _) => SimpleTyKind :: Sequence ,
266
254
267
- rustc_middle :: ty :: TyKind :: Ref ( _, _, _) => SimpleTyKind :: Reference ,
255
+ ty :: Ref ( _, _, _) => SimpleTyKind :: Reference ,
268
256
269
- rustc_middle :: ty :: TyKind :: Foreign ( _) => SimpleTyKind :: Foreign ,
270
- rustc_middle :: ty:: TyKind :: RawPtr ( _) => SimpleTyKind :: RawPtr ,
257
+ ty :: Foreign ( _) => SimpleTyKind :: Foreign ,
258
+ ty:: RawPtr ( _ , _) => SimpleTyKind :: RawPtr ,
271
259
272
- rustc_middle :: ty:: TyKind :: FnDef ( _, _) | rustc_middle :: ty :: TyKind :: FnPtr ( _) => SimpleTyKind :: Fn ,
273
- rustc_middle :: ty :: TyKind :: Closure ( _, _) => SimpleTyKind :: Closure ,
260
+ ty:: FnDef ( _, _) | ty :: FnPtr ( _) => SimpleTyKind :: Fn ,
261
+ ty :: Closure ( _, _) => SimpleTyKind :: Closure ,
274
262
275
- rustc_middle:: ty:: TyKind :: Alias ( rustc_middle:: ty:: AliasKind :: Opaque , _)
276
- | rustc_middle:: ty:: TyKind :: Dynamic ( _, _, _) => SimpleTyKind :: TraitObj ,
263
+ ty:: Alias ( ty:: AliasKind :: Opaque , _) | ty:: Dynamic ( _, _, _) => SimpleTyKind :: TraitObj ,
277
264
278
- rustc_middle :: ty :: TyKind :: Param ( _) => SimpleTyKind :: Generic ,
279
- rustc_middle :: ty:: TyKind :: Bound ( _, _) | rustc_middle :: ty :: TyKind :: Alias ( _, _) => SimpleTyKind :: Idk ,
265
+ ty :: Param ( _) => SimpleTyKind :: Generic ,
266
+ ty:: Bound ( _, _) | ty :: Alias ( _, _) => SimpleTyKind :: Idk ,
280
267
281
- rustc_middle:: ty:: TyKind :: CoroutineClosure ( _, _)
282
- | rustc_middle:: ty:: TyKind :: Coroutine ( _, _)
283
- | rustc_middle:: ty:: TyKind :: CoroutineWitness ( _, _)
284
- | rustc_middle:: ty:: TyKind :: Placeholder ( _)
285
- | rustc_middle:: ty:: TyKind :: Infer ( _)
286
- | rustc_middle:: ty:: TyKind :: Error ( _) => unreachable ! ( "{ty:#?}" ) ,
268
+ ty:: CoroutineClosure ( _, _)
269
+ | ty:: Coroutine ( _, _)
270
+ | ty:: CoroutineWitness ( _, _)
271
+ | ty:: Placeholder ( _)
272
+ | ty:: Infer ( _)
273
+ | ty:: Error ( _)
274
+ | ty:: Pat ( _, _) => unreachable ! ( "{ty:#?}" ) ,
287
275
}
288
276
}
289
277
}
0 commit comments