rust/compiler/rustc_ast/src
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
..
ast
attr Correctly handle starts in block doc comments 2022-01-19 11:18:17 +01:00
expand Make allocator_kind a query. 2021-06-20 11:52:51 +02:00
util Add test for block doc comments horizontal trim 2022-02-07 17:07:53 +01:00
ast.rs Drop tracking: improve break and continue handling 2022-02-07 16:30:30 -08:00
ast_like.rs expand: Refactor InvocationCollector visitor for better code reuse 2022-01-07 14:41:22 +08:00
entry.rs Fix ICE when main is declared in an extern block 2021-06-09 23:14:02 -04:00
lib.rs expand: Refactor InvocationCollector visitor for better code reuse 2022-01-07 14:41:22 +08:00
mut_visit.rs Add term 2022-01-17 17:20:57 +00:00
node_id.rs Use LocalExpnId where possible. 2021-07-17 19:41:02 +02:00
ptr.rs Make Decodable and Decoder infallible. 2022-01-22 10:38:31 +11:00
token.rs Use TokenKind::similar_tokens() 2021-10-04 22:13:00 +02:00
tokenstream.rs Make Decodable and Decoder infallible. 2022-01-22 10:38:31 +11:00
visit.rs Add term 2022-01-17 17:20:57 +00:00