@@ -161,7 +161,7 @@ pub struct Body<'tcx> {
161161
162162 /// A list of source scopes; these are referenced by statements
163163 /// and used for debuginfo. Indexed by a `SourceScope`.
164- pub source_scopes : IndexVec < SourceScope , SourceScopeData > ,
164+ pub source_scopes : IndexVec < SourceScope , SourceScopeData < ' tcx > > ,
165165
166166 /// The yield type of the function, if it is a generator.
167167 pub yield_ty : Option < Ty < ' tcx > > ,
@@ -244,7 +244,7 @@ impl<'tcx> Body<'tcx> {
244244 pub fn new (
245245 source : MirSource < ' tcx > ,
246246 basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
247- source_scopes : IndexVec < SourceScope , SourceScopeData > ,
247+ source_scopes : IndexVec < SourceScope , SourceScopeData < ' tcx > > ,
248248 local_decls : LocalDecls < ' tcx > ,
249249 user_type_annotations : ty:: CanonicalUserTypeAnnotations < ' tcx > ,
250250 arg_count : usize ,
@@ -1868,11 +1868,16 @@ rustc_index::newtype_index! {
18681868 }
18691869}
18701870
1871- #[ derive( Clone , Debug , TyEncodable , TyDecodable , HashStable ) ]
1872- pub struct SourceScopeData {
1871+ #[ derive( Clone , Debug , TyEncodable , TyDecodable , HashStable , TypeFoldable ) ]
1872+ pub struct SourceScopeData < ' tcx > {
18731873 pub span : Span ,
18741874 pub parent_scope : Option < SourceScope > ,
18751875
1876+ /// Whether this scope is the root of a scope tree of another body,
1877+ /// inlined into this body by the MIR inliner.
1878+ /// `ty::Instance` is the callee, and the `Span` is the call site.
1879+ pub inlined : Option < ( ty:: Instance < ' tcx > , Span ) > ,
1880+
18761881 /// Crate-local information for this source scope, that can't (and
18771882 /// needn't) be tracked across crates.
18781883 pub local_data : ClearCrossCrate < SourceScopeLocalData > ,
0 commit comments