Skip to content
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

Merged
merged 3 commits into from
Aug 30, 2014
Merged

Conversation

Pythoner6
Copy link
Contributor

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.

@@ -5313,7 +5313,7 @@ impl<'a> Resolver<'a> {
visit::walk_expr(self, expr, ());
}

ExprLoop(_, Some(label)) => {
ExprLoop(_, Some(label)) | ExprWhile(_, _, Some(label)) => {
Copy link
Contributor Author

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)

@alexcrichton
Copy link
Member

Sorry for taking awhile to get around to this, but this looks great, thank you!

@brson
Copy link
Contributor

brson commented Aug 22, 2014

Error is legit.

@Pythoner6
Copy link
Contributor Author

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.

@alexcrichton
Copy link
Member

It looks like these commits have gotten all tangled up, @Pythoner6 perhaps a rebase is in order?

@Pythoner6
Copy link
Contributor Author

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.

@alexcrichton
Copy link
Member

You may want to checkout a fresh branch and git cherry-pick your commits over, as a git rebase may not actually work well at this point.

@Pythoner6
Copy link
Contributor Author

I figured as much. Will I have to create a new pull request for that branch then?

@alexcrichton
Copy link
Member

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.

bors added a commit that referenced this pull request Aug 30, 2014
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.
@bors bors closed this Aug 30, 2014
@bors bors merged commit e76db8e into rust-lang:master Aug 30, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 3, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use label for while loop
4 participants