-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
implement RFC 1192 inclusive ranges #30884
Merged
Merged
Commits on Feb 27, 2016
-
core: add inclusive ranges to core::ops
Since it removes the old iter::{range_inclusive, RangeInclusive} which were unstable and deprecated, this is a [breaking-change] on nightly.
Configuration menu - View commit details
-
Copy full SHA for c5d58de - Browse repository at this point
Copy the full SHA c5d58deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5daf13c - Browse repository at this point
Copy the full SHA 5daf13cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a331278 - Browse repository at this point
Copy the full SHA a331278View commit details -
fallout from removing hir::ExprRange
A whole bunch of stuff gets folded into struct handling! Plus, removes an ugly hack from trans and accidentally fixes a bug with constructing ranges from references (see later commits with tests).
Configuration menu - View commit details
-
Copy full SHA for d792183 - Browse repository at this point
Copy the full SHA d792183View commit details -
The range desugaring does not use the lang items. Hence I did not add lang items for inclusive ranges. This cleanup commit removes the old unused ones as well. Whether the desugaring _should_ use lang items is another question: see rust-lang#30809. But if we decide on a strategy there we can add back these lang items, and new ones for inclusive ranges. For stage0 we need to keep the attributes as the lang items still exist even if they are never used. This is surprisingly not a breaking change. Unused #[lang] attributes do not even trigger a lint (see rust-lang#30881).
Configuration menu - View commit details
-
Copy full SHA for bd3197c - Browse repository at this point
Copy the full SHA bd3197cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 37a4cb3 - Browse repository at this point
Copy the full SHA 37a4cb3View commit details -
Mostly copy the tests from half-open ranges, adding some more for DoubleEndedIterator and ExactSizeIterator. Also thoroughly (I think) test that the feature gates are working.
Configuration menu - View commit details
-
Copy full SHA for 69719df - Browse repository at this point
Copy the full SHA 69719dfView commit details -
Since the desugaring removed special handling for ranges, the error message changed and so I had to adjust `range-1`. Turns out there was a bug where borrowck was too restrictive in some rare cases of constructing ranges from literals. The `range-2` test enshrined this bug -- now it's adjusted to test a case that's actually wrong.
Configuration menu - View commit details
-
Copy full SHA for e10614a - Browse repository at this point
Copy the full SHA e10614aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 15a8a29 - Browse repository at this point
Copy the full SHA 15a8a29View commit details -
In particular, uses of inclusive ranges within the standard library are still waiting. Slices and collections can be sliced with `usize` and `Range*<usize>`, but not yet `Range*Inclusive<usize>`. Also, we need to figure out what to do about `RangeArgument`. Currently it has `start()` and `end()` methods which are pretty much identical to `Range::start` and `Range::end`. For the same reason as Range itself, these methods can't express a range such as `0...255u8` without overflow. The easiest choice, it seems to me, is either changing the meaning of `end()` to be inclusive, or adding a new method, say `last()`, that is inclusive and specifying that `end()` returns `None` in cases where it would overflow. Changing the semantics would be a breaking change, but `RangeArgument` is unstable so maybe we should do it anyway.
Configuration menu - View commit details
-
Copy full SHA for 24cc902 - Browse repository at this point
Copy the full SHA 24cc902View commit details -
Configuration menu - View commit details
-
Copy full SHA for b1b4f50 - Browse repository at this point
Copy the full SHA b1b4f50View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7eb7c56 - Browse repository at this point
Copy the full SHA 7eb7c56View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ec3005 - Browse repository at this point
Copy the full SHA 1ec3005View commit details -
Configuration menu - View commit details
-
Copy full SHA for f27a3a3 - Browse repository at this point
Copy the full SHA f27a3a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1530365 - Browse repository at this point
Copy the full SHA 1530365View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54cb2d9 - Browse repository at this point
Copy the full SHA 54cb2d9View commit details
Commits on Mar 4, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 003120a - Browse repository at this point
Copy the full SHA 003120aView commit details -
Configuration menu - View commit details
-
Copy full SHA for a928c83 - Browse repository at this point
Copy the full SHA a928c83View commit details -
Configuration menu - View commit details
-
Copy full SHA for 430b3e1 - Browse repository at this point
Copy the full SHA 430b3e1View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.