@@ -62,7 +62,7 @@ impl<'tcx> HasLocalDecls<'tcx> for LocalDecls<'tcx> {
62
62
}
63
63
}
64
64
65
- impl < ' tcx > HasLocalDecls < ' tcx > for Mir < ' tcx > {
65
+ impl < ' tcx > HasLocalDecls < ' tcx > for Body < ' tcx > {
66
66
fn local_decls ( & self ) -> & LocalDecls < ' tcx > {
67
67
& self . local_decls
68
68
}
@@ -88,7 +88,7 @@ impl MirPhase {
88
88
89
89
/// Lowered representation of a single function.
90
90
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
91
- pub struct Mir < ' tcx > {
91
+ pub struct Body < ' tcx > {
92
92
/// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
93
93
/// that indexes into this vector.
94
94
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
@@ -109,15 +109,15 @@ pub struct Mir<'tcx> {
109
109
pub source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
110
110
111
111
/// Rvalues promoted from this function, such as borrows of constants.
112
- /// Each of them is the Mir of a constant with the fn's type parameters
112
+ /// Each of them is the Body of a constant with the fn's type parameters
113
113
/// in scope, but a separate set of locals.
114
- pub promoted : IndexVec < Promoted , Mir < ' tcx > > ,
114
+ pub promoted : IndexVec < Promoted , Body < ' tcx > > ,
115
115
116
116
/// Yields type of the function, if it is a generator.
117
117
pub yield_ty : Option < Ty < ' tcx > > ,
118
118
119
119
/// Generator drop glue
120
- pub generator_drop : Option < Box < Mir < ' tcx > > > ,
120
+ pub generator_drop : Option < Box < Body < ' tcx > > > ,
121
121
122
122
/// The layout of a generator. Produced by the state transformation.
123
123
pub generator_layout : Option < GeneratorLayout < ' tcx > > ,
@@ -169,12 +169,12 @@ pub struct Mir<'tcx> {
169
169
cache : cache:: Cache ,
170
170
}
171
171
172
- impl < ' tcx > Mir < ' tcx > {
172
+ impl < ' tcx > Body < ' tcx > {
173
173
pub fn new (
174
174
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
175
175
source_scopes : IndexVec < SourceScope , SourceScopeData > ,
176
176
source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
177
- promoted : IndexVec < Promoted , Mir < ' tcx > > ,
177
+ promoted : IndexVec < Promoted , Body < ' tcx > > ,
178
178
yield_ty : Option < Ty < ' tcx > > ,
179
179
local_decls : LocalDecls < ' tcx > ,
180
180
user_type_annotations : CanonicalUserTypeAnnotations < ' tcx > ,
@@ -191,7 +191,7 @@ impl<'tcx> Mir<'tcx> {
191
191
local_decls. len( )
192
192
) ;
193
193
194
- Mir {
194
+ Body {
195
195
phase : MirPhase :: Build ,
196
196
basic_blocks,
197
197
source_scopes,
@@ -425,7 +425,7 @@ pub enum Safety {
425
425
ExplicitUnsafe ( hir:: HirId ) ,
426
426
}
427
427
428
- impl_stable_hash_for ! ( struct Mir <' tcx> {
428
+ impl_stable_hash_for ! ( struct Body <' tcx> {
429
429
phase,
430
430
basic_blocks,
431
431
source_scopes,
@@ -444,7 +444,7 @@ impl_stable_hash_for!(struct Mir<'tcx> {
444
444
cache
445
445
} ) ;
446
446
447
- impl < ' tcx > Index < BasicBlock > for Mir < ' tcx > {
447
+ impl < ' tcx > Index < BasicBlock > for Body < ' tcx > {
448
448
type Output = BasicBlockData < ' tcx > ;
449
449
450
450
#[ inline]
@@ -453,7 +453,7 @@ impl<'tcx> Index<BasicBlock> for Mir<'tcx> {
453
453
}
454
454
}
455
455
456
- impl < ' tcx > IndexMut < BasicBlock > for Mir < ' tcx > {
456
+ impl < ' tcx > IndexMut < BasicBlock > for Body < ' tcx > {
457
457
#[ inline]
458
458
fn index_mut ( & mut self , index : BasicBlock ) -> & mut BasicBlockData < ' tcx > {
459
459
& mut self . basic_blocks_mut ( ) [ index]
@@ -601,7 +601,7 @@ newtype_index! {
601
601
}
602
602
}
603
603
604
- /// Classifies locals into categories. See `Mir ::local_kind`.
604
+ /// Classifies locals into categories. See `Body ::local_kind`.
605
605
#[ derive( PartialEq , Eq , Debug , HashStable ) ]
606
606
pub enum LocalKind {
607
607
/// User-declared variable binding
@@ -2897,23 +2897,23 @@ fn def_path_str(def_id: DefId) -> String {
2897
2897
ty:: tls:: with ( |tcx| tcx. def_path_str ( def_id) )
2898
2898
}
2899
2899
2900
- impl < ' tcx > graph:: DirectedGraph for Mir < ' tcx > {
2900
+ impl < ' tcx > graph:: DirectedGraph for Body < ' tcx > {
2901
2901
type Node = BasicBlock ;
2902
2902
}
2903
2903
2904
- impl < ' tcx > graph:: WithNumNodes for Mir < ' tcx > {
2904
+ impl < ' tcx > graph:: WithNumNodes for Body < ' tcx > {
2905
2905
fn num_nodes ( & self ) -> usize {
2906
2906
self . basic_blocks . len ( )
2907
2907
}
2908
2908
}
2909
2909
2910
- impl < ' tcx > graph:: WithStartNode for Mir < ' tcx > {
2910
+ impl < ' tcx > graph:: WithStartNode for Body < ' tcx > {
2911
2911
fn start_node ( & self ) -> Self :: Node {
2912
2912
START_BLOCK
2913
2913
}
2914
2914
}
2915
2915
2916
- impl < ' tcx > graph:: WithPredecessors for Mir < ' tcx > {
2916
+ impl < ' tcx > graph:: WithPredecessors for Body < ' tcx > {
2917
2917
fn predecessors < ' graph > (
2918
2918
& ' graph self ,
2919
2919
node : Self :: Node ,
@@ -2922,7 +2922,7 @@ impl<'tcx> graph::WithPredecessors for Mir<'tcx> {
2922
2922
}
2923
2923
}
2924
2924
2925
- impl < ' tcx > graph:: WithSuccessors for Mir < ' tcx > {
2925
+ impl < ' tcx > graph:: WithSuccessors for Body < ' tcx > {
2926
2926
fn successors < ' graph > (
2927
2927
& ' graph self ,
2928
2928
node : Self :: Node ,
@@ -2931,12 +2931,12 @@ impl<'tcx> graph::WithSuccessors for Mir<'tcx> {
2931
2931
}
2932
2932
}
2933
2933
2934
- impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Mir < ' a > {
2934
+ impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Body < ' a > {
2935
2935
type Item = BasicBlock ;
2936
2936
type Iter = IntoIter < BasicBlock > ;
2937
2937
}
2938
2938
2939
- impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Mir < ' a > {
2939
+ impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Body < ' a > {
2940
2940
type Item = BasicBlock ;
2941
2941
type Iter = iter:: Cloned < Successors < ' b > > ;
2942
2942
}
@@ -2975,7 +2975,7 @@ impl Location {
2975
2975
}
2976
2976
2977
2977
/// Returns `true` if `other` is earlier in the control flow graph than `self`.
2978
- pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Mir < ' tcx > ) -> bool {
2978
+ pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Body < ' tcx > ) -> bool {
2979
2979
// If we are in the same block as the other location and are an earlier statement
2980
2980
// then we are a predecessor of `other`.
2981
2981
if self . block == other. block && self . statement_index < other. statement_index {
@@ -3228,7 +3228,7 @@ CloneTypeFoldableAndLiftImpls! {
3228
3228
}
3229
3229
3230
3230
BraceStructTypeFoldableImpl ! {
3231
- impl <' tcx> TypeFoldable <' tcx> for Mir <' tcx> {
3231
+ impl <' tcx> TypeFoldable <' tcx> for Body <' tcx> {
3232
3232
phase,
3233
3233
basic_blocks,
3234
3234
source_scopes,
0 commit comments