@@ -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
@@ -2853,23 +2853,23 @@ fn def_path_str(def_id: DefId) -> String {
2853
2853
ty:: tls:: with ( |tcx| tcx. def_path_str ( def_id) )
2854
2854
}
2855
2855
2856
- impl < ' tcx > graph:: DirectedGraph for Mir < ' tcx > {
2856
+ impl < ' tcx > graph:: DirectedGraph for Body < ' tcx > {
2857
2857
type Node = BasicBlock ;
2858
2858
}
2859
2859
2860
- impl < ' tcx > graph:: WithNumNodes for Mir < ' tcx > {
2860
+ impl < ' tcx > graph:: WithNumNodes for Body < ' tcx > {
2861
2861
fn num_nodes ( & self ) -> usize {
2862
2862
self . basic_blocks . len ( )
2863
2863
}
2864
2864
}
2865
2865
2866
- impl < ' tcx > graph:: WithStartNode for Mir < ' tcx > {
2866
+ impl < ' tcx > graph:: WithStartNode for Body < ' tcx > {
2867
2867
fn start_node ( & self ) -> Self :: Node {
2868
2868
START_BLOCK
2869
2869
}
2870
2870
}
2871
2871
2872
- impl < ' tcx > graph:: WithPredecessors for Mir < ' tcx > {
2872
+ impl < ' tcx > graph:: WithPredecessors for Body < ' tcx > {
2873
2873
fn predecessors < ' graph > (
2874
2874
& ' graph self ,
2875
2875
node : Self :: Node ,
@@ -2878,7 +2878,7 @@ impl<'tcx> graph::WithPredecessors for Mir<'tcx> {
2878
2878
}
2879
2879
}
2880
2880
2881
- impl < ' tcx > graph:: WithSuccessors for Mir < ' tcx > {
2881
+ impl < ' tcx > graph:: WithSuccessors for Body < ' tcx > {
2882
2882
fn successors < ' graph > (
2883
2883
& ' graph self ,
2884
2884
node : Self :: Node ,
@@ -2887,12 +2887,12 @@ impl<'tcx> graph::WithSuccessors for Mir<'tcx> {
2887
2887
}
2888
2888
}
2889
2889
2890
- impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Mir < ' a > {
2890
+ impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Body < ' a > {
2891
2891
type Item = BasicBlock ;
2892
2892
type Iter = IntoIter < BasicBlock > ;
2893
2893
}
2894
2894
2895
- impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Mir < ' a > {
2895
+ impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Body < ' a > {
2896
2896
type Item = BasicBlock ;
2897
2897
type Iter = iter:: Cloned < Successors < ' b > > ;
2898
2898
}
@@ -2931,7 +2931,7 @@ impl Location {
2931
2931
}
2932
2932
2933
2933
/// Returns `true` if `other` is earlier in the control flow graph than `self`.
2934
- pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Mir < ' tcx > ) -> bool {
2934
+ pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Body < ' tcx > ) -> bool {
2935
2935
// If we are in the same block as the other location and are an earlier statement
2936
2936
// then we are a predecessor of `other`.
2937
2937
if self . block == other. block && self . statement_index < other. statement_index {
@@ -3165,7 +3165,7 @@ CloneTypeFoldableAndLiftImpls! {
3165
3165
}
3166
3166
3167
3167
BraceStructTypeFoldableImpl ! {
3168
- impl <' tcx> TypeFoldable <' tcx> for Mir <' tcx> {
3168
+ impl <' tcx> TypeFoldable <' tcx> for Body <' tcx> {
3169
3169
phase,
3170
3170
basic_blocks,
3171
3171
source_scopes,
0 commit comments