about summary refs log tree commit diff
path: root/src/test/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2019-06-05 19:54:34 -0400
committerAaron Hill <aa1ronham@gmail.com>2019-06-22 16:00:48 -0400
commit9d0960a6f8fbd561b2f5d9fb54ba49d533f61832 (patch)
tree4b52f8cca53781e6f903f61aed4f02366af94009 /src/test/debuginfo/enum-thinlto.rs
parent4a365a29d64bec75d107214319a129ba68fc12a3 (diff)
downloadrust-9d0960a6f8fbd561b2f5d9fb54ba49d533f61832.tar.gz
rust-9d0960a6f8fbd561b2f5d9fb54ba49d533f61832.zip
Fix HIR visit order
Fixes #61442

When rustc::middle::region::ScopeTree ccomputes its yield_in_scope
field, it relies on the HIR visitor order to properly compute which
types must be live across yield points. In order for the computed scopes
to agree with the generated MIR, we must ensure that expressions
evaluated before a yield point are visited before the 'yield'
expression.

However, the visitor order for ExprKind::AssignOp
was incorrect. The left-hand side of a compund assignment expression is
evaluated before the right-hand side, but the right-hand expression was
being visited before the left-hand expression. If the left-hand
expression caused a new type to be introduced (e.g. through a
deref-coercion), the new type would be incorrectly seen as occuring
*after* the yield point, instead of before. This leads to a mismatch
between the computed generator types and the MIR, since the MIR will
correctly see the type as being live across the yield point.

To fix this, we correct the visitor order for ExprKind::AssignOp
to reflect the actual evaulation order.
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions