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

Type-check break value; even outside of loop {}. #43745

Merged
merged 1 commit into from
Aug 11, 2017

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Aug 8, 2017

Fix #43162, fix #43727.

@rust-highfive
Copy link
Collaborator

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@kennytm
Copy link
Member Author

kennytm commented Aug 8, 2017

(The break rust; thing is following #43162 (comment). It can be reverted if considered inappropriate.)

@zackmdavis
Copy link
Member

It can be reverted if considered inappropriate.

I don't think the type-checker of a production compiler is a good place for easter eggs.

(For comparison, Python has import this and from __future__ import braces, but it feels significant that those are tucked away in the standard library, rather than affecting the semantics of the language itself.)

@kennytm
Copy link
Member Author

kennytm commented Aug 8, 2017

@zachreizner Not saying the feature should stay (I may delete those in 1 or 2 days r+'ed 🎊)... but the change does not affect the semantics of the language itself, since entering that branch already indicates the code is wrong and is going to fail soon anyway (which is also the reason why I've added an extra test case to run-pass to ensure normal code is not affected).

@arielb1
Copy link
Contributor

arielb1 commented Aug 8, 2017

Generally r=me, but we need signoff from @aturon for all new features.

@arielb1
Copy link
Contributor

arielb1 commented Aug 8, 2017

I think we could also go with signoff from our release manager, @brson

@arielb1 arielb1 added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-core Relevant to the core team, which will review and decide on the PR/issue. labels Aug 8, 2017
@aturon
Copy link
Member

aturon commented Aug 8, 2017

@bors: r+

for as long as we can get away with it

@bors
Copy link
Contributor

bors commented Aug 8, 2017

📌 Commit 3cb23a7 has been approved by aturon

@killercup
Copy link
Member

This is awesome. I'll wait for the first nightly that includes this and pin all my projects to it!

@aidanhs aidanhs added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Aug 10, 2017
@jD91mZM2
Copy link
Contributor

Does this only work outside of loops? Or is it a breaking change?

@bors
Copy link
Contributor

bors commented Aug 11, 2017

⌛ Testing commit 3cb23a7 with merge 9868352...

bors added a commit that referenced this pull request Aug 11, 2017
Type-check `break value;` even outside of `loop {}`.

Fix #43162, fix #43727.
@bors
Copy link
Contributor

bors commented Aug 11, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: aturon
Pushing 9868352 to master...

@bors bors merged commit 3cb23a7 into rust-lang:master Aug 11, 2017
@kennytm kennytm deleted the fix-43162 branch November 5, 2017 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-core Relevant to the core team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: no type for node nightly ICEs on invalid code with break outside of loop
9 participants