You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MIR inlining does not handle SourceScopeLocalData #66137
During the MIR inlining pass, we add scopes from the callee to Body.source_scopes in the caller. However, we do not update source_scope_local_data, which causes any inlined scopes to have no entry in the caller source_scope_local_data. This causes an ICE in Miri when we try to generate a stacktrace - however, the ICE occurs in rustc code, so it's possible that we might run across this without Miri.
I don't think this is E-Easy - source_scope_local_data is crate local, and it's not immediately obvious to me what the correct beehvaior is for cross-crate inlining.
@Aaron1011 Oh, I thought the concern was entirely about same-crate, sorry!
I think the fix in that case is to move the ClearCrossCrate inward, i.e. change SourceScopeData to contain a ClearCrossCrate<SourceScopeLocalData> - I don't think the size of SourceScopeData is critical (but we should run perf anyway).
@eddyb: SourceScopeData doesn't contain SourceScopeLocalData. Your change would require wrapping both fields of SourceScopeLocalData in ClearCrossCrate, since SourceScopeLocalData is stored in an IndexVec in Body.source_scope_local_data
Activity
[-]MIR inlinging does not handle `SourceScopeLocalData`[/-][+]MIR inlining does not handle `SourceScopeLocalData`[/+]eddyb commentedon Nov 6, 2019
Sounds like a simple enough omission, but I'm surprised this doesn't break any of our
mir-opttests.Aaron1011 commentedon Nov 6, 2019
I don't think this is
E-Easy-source_scope_local_datais crate local, and it's not immediately obvious to me what the correct beehvaior is for cross-crate inlining.Dylan-DPC-zz commentedon Nov 13, 2019
@rustbot assign @Aaron1011
Fix generating CTFE backtrace on optimized MIR
eddyb commentedon Nov 13, 2019
@Aaron1011 Oh, I thought the concern was entirely about same-crate, sorry!
I think the fix in that case is to move the
ClearCrossCrateinward, i.e. changeSourceScopeDatato contain aClearCrossCrate<SourceScopeLocalData>- I don't think the size ofSourceScopeDatais critical (but we should run perf anyway).Aaron1011 commentedon Nov 14, 2019
@eddyb:
SourceScopeDatadoesn't containSourceScopeLocalData. Your change would require wrapping both fields ofSourceScopeLocalDatainClearCrossCrate, sinceSourceScopeLocalDatais stored in anIndexVecinBody.source_scope_local_dataAaron1011 commentedon Nov 14, 2019
Oops, I misread your proposal - you were talking about changing
SourceScopeDatato contain aSourceScopeLocalData. I'll try that.oli-obk commentedon Dec 29, 2019
This was fixed in #66789 as far as I can tell