Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCheck for duplicate loop labels in function bodies. #24162
Conversation
rust-highfive
assigned
eddyb
Apr 7, 2015
This comment has been minimized.
This comment has been minimized.
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
(this isn't really done; at the very least, it needs a test or two, and I want to wait to see feedback from the |
This comment has been minimized.
This comment has been minimized.
|
Okay, added tests, and I guess the internals thread isn't going to get much action now. |
rust-highfive
assigned
nikomatsakis
and unassigned
eddyb
Apr 8, 2015
This comment has been minimized.
This comment has been minimized.
|
r+ modulo nit |
pnkfelix
force-pushed the
pnkfelix:fsk-detect-duplicate-loop-labels
branch
2 times, most recently
from
05d4881
to
816a500
Apr 9, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Mind skimming over the additions from ed5ac77 ? |
pnkfelix
force-pushed the
pnkfelix:fsk-detect-duplicate-loop-labels
branch
3 times, most recently
from
096f296
to
46e0d94
Apr 10, 2015
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis this definitely needs a re-review now. |
pnkfelix
force-pushed the
pnkfelix:fsk-detect-duplicate-loop-labels
branch
from
46e0d94
to
f4c39cb
Apr 10, 2015
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix r+ modulo nit (your call on whether to make an issue) This actually does feel cleaner to me. Doing the pre-pass to collect the labels is nice. |
pnkfelix
referenced this pull request
Apr 10, 2015
Open
name-based comparison in new label-shadowing check has likely hygiene issues. #24278
pnkfelix
force-pushed the
pnkfelix:fsk-detect-duplicate-loop-labels
branch
from
f4c39cb
to
e6880ab
Apr 10, 2015
This comment has been minimized.
This comment has been minimized.
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this pull request
Apr 10, 2015
This comment has been minimized.
This comment has been minimized.
|
@bors r- (there's some test fallout I need to address) |
This comment has been minimized.
This comment has been minimized.
|
(no this still does not work...) |
This comment has been minimized.
This comment has been minimized.
|
(The main difficulty remaining is the handling of hygiene. My current approach to collapsing the rules so that labels are scoped to the entire function body does not play well with our (mis)handling of hygiene for lifetime-like things... at this point this might not happen for 1.0, in which case we will just have to live with the unfortunate scoping rules and work around them if we add e.g. |
pnkfelix
force-pushed the
pnkfelix:fsk-detect-duplicate-loop-labels
branch
from
fdb8414
to
aafed03
Apr 18, 2015
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Apr 21, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix travis only runs |
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik ah, I had been under the impression that it did a |
pnkfelix
added some commits
Apr 3, 2015
pnkfelix
force-pushed the
pnkfelix:fsk-detect-duplicate-loop-labels
branch
from
e46b32b
to
2b3cd40
Apr 21, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
long ago it did, but it would time out and such so https://github.com/rust-lang/rust/blob/master/.travis.yml#L17 |
This comment has been minimized.
This comment has been minimized.
|
@bors: rollup- |
bors
added a commit
that referenced
this pull request
Apr 21, 2015
This comment has been minimized.
This comment has been minimized.
steveklabnik
added
the
beta-nominated
label
Apr 21, 2015
This comment has been minimized.
This comment has been minimized.
|
Since this is future-proofing, I'm adding beta-nominated |
This comment has been minimized.
This comment has been minimized.
|
@bors: p=1 |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Apr 21, 2015
This comment has been minimized.
This comment has been minimized.
bors
merged commit 2b3cd40
into
rust-lang:master
Apr 21, 2015
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik wrote:
ah. Maybe we could try doing a "build" that just runs the type+borrow checking for a stage1 build, via Update: never mind, that would not suffice today, since |
alexcrichton
referenced this pull request
Apr 23, 2015
Merged
Cherry-picking beta-nominated in to beta #24708
pnkfelix
added
beta-accepted
and removed
beta-accepted
labels
Apr 23, 2015
This comment has been minimized.
This comment has been minimized.
|
i was not sure about whether to accept, but since it is already part of alex's rollup: going from nominated to (nominated, accepted) |
pnkfelix commentedApr 7, 2015
Check for duplicate loop labels in function bodies.
See also: http://internals.rust-lang.org/t/psa-rejecting-duplicate-loop-labels/1833
The change, which we are putting in as future-proofing in preparation for future potential additions to the language (namely labeling arbitrary blocks and using those labels in borrow expressions), means that code like this will start emitting warnings:
To make the above code compile without warnings, write this instead:
Since this change is only introducing a new warnings, this change is non-breaking.
Fix #21633