@@ -112,7 +112,7 @@ pub struct Body<'tcx> {
112
112
113
113
/// A list of source scopes; these are referenced by statements
114
114
/// and used for debuginfo. Indexed by a `SourceScope`.
115
- pub source_scopes : IndexVec < SourceScope , SourceScopeData > ,
115
+ pub source_scopes : IndexVec < SourceScope , SourceScopeData < ' tcx > > ,
116
116
117
117
/// The yield type of the function, if it is a generator.
118
118
pub yield_ty : Option < Ty < ' tcx > > ,
@@ -179,7 +179,7 @@ pub struct Body<'tcx> {
179
179
impl < ' tcx > Body < ' tcx > {
180
180
pub fn new (
181
181
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
182
- source_scopes : IndexVec < SourceScope , SourceScopeData > ,
182
+ source_scopes : IndexVec < SourceScope , SourceScopeData < ' tcx > > ,
183
183
local_decls : LocalDecls < ' tcx > ,
184
184
user_type_annotations : CanonicalUserTypeAnnotations < ' tcx > ,
185
185
arg_count : usize ,
@@ -1916,11 +1916,16 @@ rustc_index::newtype_index! {
1916
1916
}
1917
1917
}
1918
1918
1919
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
1920
- pub struct SourceScopeData {
1919
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
1920
+ pub struct SourceScopeData < ' tcx > {
1921
1921
pub span : Span ,
1922
1922
pub parent_scope : Option < SourceScope > ,
1923
1923
1924
+ /// Whether this scope is the root of a scope tree of another body,
1925
+ /// inlined into this body by the MIR inliner.
1926
+ /// `ty::Instance` is the callee, and the `Span` is the call site.
1927
+ pub inlined : Option < ( ty:: Instance < ' tcx > , Span ) > ,
1928
+
1924
1929
/// Crate-local information for this source scope, that can't (and
1925
1930
/// needn't) be tracked across crates.
1926
1931
pub local_data : ClearCrossCrate < SourceScopeLocalData > ,
@@ -2621,7 +2626,6 @@ CloneTypeFoldableAndLiftImpls! {
2621
2626
FakeReadCause ,
2622
2627
RetagKind ,
2623
2628
SourceScope ,
2624
- SourceScopeData ,
2625
2629
SourceScopeLocalData ,
2626
2630
UserTypeAnnotationIndex ,
2627
2631
}
0 commit comments