about summary refs log tree commit diff
path: root/src/test/ui/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-06-25 02:17:05 +0000
committerbors <bors@rust-lang.org>2019-06-25 02:17:05 +0000
commit53ae6d2eb5352cc20f2e9b92847d92e935639f3c (patch)
treed19d826f7c3921ca6f3de654e33039c0e6b26a95 /src/test/ui/thinlto
parenta5b17298f2d1c5994c73e540ce7c44830af0d4dc (diff)
parent770655a47f9577b15e499a76f87b903bbde93c3b (diff)
downloadrust-53ae6d2eb5352cc20f2e9b92847d92e935639f3c.tar.gz
rust-53ae6d2eb5352cc20f2e9b92847d92e935639f3c.zip
Auto merge of #61572 - Aaron1011:fix/generator-ref, r=varkor
Fix HIR visit order

Fixes #61442

When rustc::middle::region::ScopeTree computes 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/ui/thinlto')
0 files changed, 0 insertions, 0 deletions