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`
This commit is contained in:
commit
0c3f0cddde
4 changed files with 114 additions and 10 deletions
|
@ -54,7 +54,7 @@ mod tests;
|
|||
/// ```
|
||||
///
|
||||
/// `'outer` is a label.
|
||||
#[derive(Clone, Encodable, Decodable, Copy, HashStable_Generic)]
|
||||
#[derive(Clone, Encodable, Decodable, Copy, HashStable_Generic, Eq, PartialEq)]
|
||||
pub struct Label {
|
||||
pub ident: Ident,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue