@@ -112,7 +112,7 @@ pub struct Body<'tcx> {
112112
113113 /// A list of source scopes; these are referenced by statements
114114 /// and used for debuginfo. Indexed by a `SourceScope`.
115- pub source_scopes : IndexVec < SourceScope , SourceScopeData > ,
115+ pub source_scopes : IndexVec < SourceScope , SourceScopeData < ' tcx > > ,
116116
117117 /// The yield type of the function, if it is a generator.
118118 pub yield_ty : Option < Ty < ' tcx > > ,
@@ -179,7 +179,7 @@ pub struct Body<'tcx> {
179179impl < ' tcx > Body < ' tcx > {
180180 pub fn new (
181181 basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
182- source_scopes : IndexVec < SourceScope , SourceScopeData > ,
182+ source_scopes : IndexVec < SourceScope , SourceScopeData < ' tcx > > ,
183183 local_decls : LocalDecls < ' tcx > ,
184184 user_type_annotations : CanonicalUserTypeAnnotations < ' tcx > ,
185185 arg_count : usize ,
@@ -1916,11 +1916,16 @@ rustc_index::newtype_index! {
19161916 }
19171917}
19181918
1919- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
1920- pub struct SourceScopeData {
1919+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
1920+ pub struct SourceScopeData < ' tcx > {
19211921 pub span : Span ,
19221922 pub parent_scope : Option < SourceScope > ,
19231923
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+
19241929 /// Crate-local information for this source scope, that can't (and
19251930 /// needn't) be tracked across crates.
19261931 pub local_data : ClearCrossCrate < SourceScopeLocalData > ,
@@ -2621,7 +2626,6 @@ CloneTypeFoldableAndLiftImpls! {
26212626 FakeReadCause ,
26222627 RetagKind ,
26232628 SourceScope ,
2624- SourceScopeData ,
26252629 SourceScopeLocalData ,
26262630 UserTypeAnnotationIndex ,
26272631}
0 commit comments