rust/compiler
bors 0c3f0cddde Auto merge of #93752 - eholk:drop-tracking-break-continue, r=nikomatsakis
Generator drop tracking: improve break and continue handling

This PR fixes two related issues.

One, sometimes break or continue have a block target instead of an expression target. This seems to mainly happen with try blocks. Since the drop tracking analysis only works on expressions, if we see a block target for break or continue, we substitute the last expression of the block as the target instead.

Two, break and continue were incorrectly being treated as the same, so continue would also show up as an exit from the loop or block. This patch corrects the way continue is handled by keeping a stack of loop entry points and uses those to find the target of the continue.

Fixes #93197

r? `@nikomatsakis`
2022-02-15 02:27:37 +00:00
..
2022-02-13 11:49:52 +01:00
2022-02-13 11:49:52 +01:00
2022-02-12 11:23:53 +00:00
2022-02-12 11:23:53 +00:00
2022-02-12 11:23:53 +00:00