-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for labeled while loops #16190
Conversation
@@ -5313,7 +5313,7 @@ impl<'a> Resolver<'a> { | |||
visit::walk_expr(self, expr, ()); | |||
} | |||
|
|||
ExprLoop(_, Some(label)) => { | |||
ExprLoop(_, Some(label)) | ExprWhile(_, _, Some(label)) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why loop
loops ignore the body here while for
loops don't - so I took what seemed to be the more conservative approach and treat while
loops like loop
loops (i.e. ignore the body and expression)
Sorry for taking awhile to get around to this, but this looks great, thank you! |
Error is legit. |
I'll fix it when I can, a bit busy right now, just starting college. Has there been a change related to alternatives in matches (or is the error caused by something else)? When I wrote the change it compiled fine on mac and Linux. |
It looks like these commits have gotten all tangled up, @Pythoner6 perhaps a rebase is in order? |
That's what I was trying to do, but git complained about needing to merge back into my fork of the project - and I'm not sure exactly what to do at this point. |
You may want to checkout a fresh branch and |
I figured as much. Will I have to create a new pull request for that branch then? |
If you force push this PR's branch github should auto-update the PR, so no need to make a new one! If things get confusing, though, it's fine to make a new PR. |
6abc1ce
to
e76db8e
Compare
Fixes #12643 > Say! > I like labelled breaks/continues! I will use them with a `for` loop. And I will use with a `loop` loop. Say! I will use them ANYWHERE! … _even_ in a `while` loop. Because they're now supported there.
…r=lnicola add test case for negative impl add a small test case to ensure that we don't emit `trait_impl_redundant_assoc_item` diagnostic for negative impl trait
Fixes #12643
I will use them with a
for
loop.And I will use with a
loop
loop.Say! I will use them ANYWHERE!
… even in a
while
loop.Because they're now supported there.