Preliminary support for labeled break/continue for loops#3807
Preliminary support for labeled break/continue for loops#3807catamorphism wants to merge 1 commit intorust-lang:incomingfrom
loops#3807Conversation
This patch adds preliminary middle-end support (liveness and trans) for breaks and `loop`s to `loop` constructs that have labels. while and for loops can't have labels yet. Progress on rust-lang#2216
|
@catamorphism @pcwalton hope you don't mind, I was scanning the pull request queue and saw that this touched on liveness, so I wanted to take a look. Overall it looks pretty reasonable (modulo some nits regarding indentation). I did have one question: Can you add a test that breaks out of a for loop, like this? Based on my testing, this test will not execute correctly (that is, "Hello, World!" and "Goodye, World!" will both print). I think it's perfectly fine if we do not support using named breaks out of for loops (at least for the moment), but we should either report an error or Do The Right Thing. Of course I could be misreading the code, but I believe that resolve accepts this (at least in my local testing) and I also believe that if it gets all the way to trans, it will simply ignore the label and break out of the for loop. Actually though what I think will happen is that it will ICE in liveness, because the hashmap mapping ids to nodes will not contain anything for |
|
I merged this. |
|
(Oh, and in response to @nikomatsakis 's last comment, I'm working on this -- it's almost done.) |
len_zero: skip ranges if feature `range_is_empty` is not enabled If the feature is not enabled, calling `is_empty()` on a range is ambiguous. Moreover, the two possible resolutions are unstable methods, one inherent to the range and the other being part of the `ExactSizeIterator` trait. Since `len_zero` only checks for existing `is_empty()` inherent methods, we only take into account the `range_is_empty` feature. Related: rust-lang#48111 (comment) changelog: len_zero: avoid linting ranges without #![feature(range_is_empty)] Fixes: rust-lang#3807
add 'project' process guidlines for larger contributions Fixes rust-lang/miri#3443 I am honestly not entirely sure what the consensus from what issue was. I feel like the epoll PR worked reasonably well, and not having been closely involved I am not sure which process `@oli-obk` followed there. Compared to the first draft in rust-lang#3443 I tried to make this less formal and framed more as guidelines than hard rules.
This patch adds preliminary middle-end support (liveness and trans)
for breaks and
loops toloopconstructs that have labels.while and for loops can't have labels yet.
Progress on #2216
r? @pcwaltonr+ from @nikomatsakis so no need for other review.