@@ -60,7 +60,7 @@ impl<'tcx> HasLocalDecls<'tcx> for LocalDecls<'tcx> {
60
60
}
61
61
}
62
62
63
- impl < ' tcx > HasLocalDecls < ' tcx > for Mir < ' tcx > {
63
+ impl < ' tcx > HasLocalDecls < ' tcx > for Body < ' tcx > {
64
64
fn local_decls ( & self ) -> & LocalDecls < ' tcx > {
65
65
& self . local_decls
66
66
}
@@ -86,7 +86,7 @@ impl MirPhase {
86
86
87
87
/// Lowered representation of a single function.
88
88
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
89
- pub struct Mir < ' tcx > {
89
+ pub struct Body < ' tcx > {
90
90
/// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
91
91
/// that indexes into this vector.
92
92
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
@@ -107,15 +107,15 @@ pub struct Mir<'tcx> {
107
107
pub source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
108
108
109
109
/// Rvalues promoted from this function, such as borrows of constants.
110
- /// Each of them is the Mir of a constant with the fn's type parameters
110
+ /// Each of them is the Body of a constant with the fn's type parameters
111
111
/// in scope, but a separate set of locals.
112
- pub promoted : IndexVec < Promoted , Mir < ' tcx > > ,
112
+ pub promoted : IndexVec < Promoted , Body < ' tcx > > ,
113
113
114
114
/// Yields type of the function, if it is a generator.
115
115
pub yield_ty : Option < Ty < ' tcx > > ,
116
116
117
117
/// Generator drop glue
118
- pub generator_drop : Option < Box < Mir < ' tcx > > > ,
118
+ pub generator_drop : Option < Box < Body < ' tcx > > > ,
119
119
120
120
/// The layout of a generator. Produced by the state transformation.
121
121
pub generator_layout : Option < GeneratorLayout < ' tcx > > ,
@@ -167,12 +167,12 @@ pub struct Mir<'tcx> {
167
167
cache : cache:: Cache ,
168
168
}
169
169
170
- impl < ' tcx > Mir < ' tcx > {
170
+ impl < ' tcx > Body < ' tcx > {
171
171
pub fn new (
172
172
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
173
173
source_scopes : IndexVec < SourceScope , SourceScopeData > ,
174
174
source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
175
- promoted : IndexVec < Promoted , Mir < ' tcx > > ,
175
+ promoted : IndexVec < Promoted , Body < ' tcx > > ,
176
176
yield_ty : Option < Ty < ' tcx > > ,
177
177
local_decls : LocalDecls < ' tcx > ,
178
178
user_type_annotations : CanonicalUserTypeAnnotations < ' tcx > ,
@@ -189,7 +189,7 @@ impl<'tcx> Mir<'tcx> {
189
189
local_decls. len( )
190
190
) ;
191
191
192
- Mir {
192
+ Body {
193
193
phase : MirPhase :: Build ,
194
194
basic_blocks,
195
195
source_scopes,
@@ -423,7 +423,7 @@ pub enum Safety {
423
423
ExplicitUnsafe ( hir:: HirId ) ,
424
424
}
425
425
426
- impl_stable_hash_for ! ( struct Mir <' tcx> {
426
+ impl_stable_hash_for ! ( struct Body <' tcx> {
427
427
phase,
428
428
basic_blocks,
429
429
source_scopes,
@@ -442,7 +442,7 @@ impl_stable_hash_for!(struct Mir<'tcx> {
442
442
cache
443
443
} ) ;
444
444
445
- impl < ' tcx > Index < BasicBlock > for Mir < ' tcx > {
445
+ impl < ' tcx > Index < BasicBlock > for Body < ' tcx > {
446
446
type Output = BasicBlockData < ' tcx > ;
447
447
448
448
#[ inline]
@@ -451,7 +451,7 @@ impl<'tcx> Index<BasicBlock> for Mir<'tcx> {
451
451
}
452
452
}
453
453
454
- impl < ' tcx > IndexMut < BasicBlock > for Mir < ' tcx > {
454
+ impl < ' tcx > IndexMut < BasicBlock > for Body < ' tcx > {
455
455
#[ inline]
456
456
fn index_mut ( & mut self , index : BasicBlock ) -> & mut BasicBlockData < ' tcx > {
457
457
& mut self . basic_blocks_mut ( ) [ index]
@@ -599,7 +599,7 @@ newtype_index! {
599
599
}
600
600
}
601
601
602
- /// Classifies locals into categories. See `Mir ::local_kind`.
602
+ /// Classifies locals into categories. See `Body ::local_kind`.
603
603
#[ derive( PartialEq , Eq , Debug , HashStable ) ]
604
604
pub enum LocalKind {
605
605
/// User-declared variable binding
@@ -2831,23 +2831,23 @@ impl<'tcx> Display for Constant<'tcx> {
2831
2831
}
2832
2832
}
2833
2833
2834
- impl < ' tcx > graph:: DirectedGraph for Mir < ' tcx > {
2834
+ impl < ' tcx > graph:: DirectedGraph for Body < ' tcx > {
2835
2835
type Node = BasicBlock ;
2836
2836
}
2837
2837
2838
- impl < ' tcx > graph:: WithNumNodes for Mir < ' tcx > {
2838
+ impl < ' tcx > graph:: WithNumNodes for Body < ' tcx > {
2839
2839
fn num_nodes ( & self ) -> usize {
2840
2840
self . basic_blocks . len ( )
2841
2841
}
2842
2842
}
2843
2843
2844
- impl < ' tcx > graph:: WithStartNode for Mir < ' tcx > {
2844
+ impl < ' tcx > graph:: WithStartNode for Body < ' tcx > {
2845
2845
fn start_node ( & self ) -> Self :: Node {
2846
2846
START_BLOCK
2847
2847
}
2848
2848
}
2849
2849
2850
- impl < ' tcx > graph:: WithPredecessors for Mir < ' tcx > {
2850
+ impl < ' tcx > graph:: WithPredecessors for Body < ' tcx > {
2851
2851
fn predecessors < ' graph > (
2852
2852
& ' graph self ,
2853
2853
node : Self :: Node ,
@@ -2856,7 +2856,7 @@ impl<'tcx> graph::WithPredecessors for Mir<'tcx> {
2856
2856
}
2857
2857
}
2858
2858
2859
- impl < ' tcx > graph:: WithSuccessors for Mir < ' tcx > {
2859
+ impl < ' tcx > graph:: WithSuccessors for Body < ' tcx > {
2860
2860
fn successors < ' graph > (
2861
2861
& ' graph self ,
2862
2862
node : Self :: Node ,
@@ -2865,12 +2865,12 @@ impl<'tcx> graph::WithSuccessors for Mir<'tcx> {
2865
2865
}
2866
2866
}
2867
2867
2868
- impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Mir < ' a > {
2868
+ impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Body < ' a > {
2869
2869
type Item = BasicBlock ;
2870
2870
type Iter = IntoIter < BasicBlock > ;
2871
2871
}
2872
2872
2873
- impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Mir < ' a > {
2873
+ impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Body < ' a > {
2874
2874
type Item = BasicBlock ;
2875
2875
type Iter = iter:: Cloned < Successors < ' b > > ;
2876
2876
}
@@ -2909,7 +2909,7 @@ impl Location {
2909
2909
}
2910
2910
2911
2911
/// Returns `true` if `other` is earlier in the control flow graph than `self`.
2912
- pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Mir < ' tcx > ) -> bool {
2912
+ pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Body < ' tcx > ) -> bool {
2913
2913
// If we are in the same block as the other location and are an earlier statement
2914
2914
// then we are a predecessor of `other`.
2915
2915
if self . block == other. block && self . statement_index < other. statement_index {
@@ -3162,7 +3162,7 @@ CloneTypeFoldableAndLiftImpls! {
3162
3162
}
3163
3163
3164
3164
BraceStructTypeFoldableImpl ! {
3165
- impl <' tcx> TypeFoldable <' tcx> for Mir <' tcx> {
3165
+ impl <' tcx> TypeFoldable <' tcx> for Body <' tcx> {
3166
3166
phase,
3167
3167
basic_blocks,
3168
3168
source_scopes,
0 commit comments