diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-12-18 17:55:04 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-12-30 13:06:24 +1300 |
| commit | ed8f5039115308ca9d5591126e4d8a77864d4730 (patch) | |
| tree | fef6c67dd64068ff73c4509d078d25ba88fa4f21 /src/libcore | |
| parent | 71123902e17ad339649f33423995eac78da40e3c (diff) | |
| download | rust-ed8f5039115308ca9d5591126e4d8a77864d4730.tar.gz rust-ed8f5039115308ca9d5591126e4d8a77864d4730.zip | |
Add hypothetical support for ranges with only an upper bound
Note that this doesn't add the surface syntax.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/ops.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 0cd8c1d69d1..f6b79ccc42b 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -908,6 +908,14 @@ impl<Idx: Clone + Step> Iterator<Idx> for RangeFrom<Idx> { } } +/// A range which is only bounded above. +#[deriving(Copy)] +#[lang="range_to"] +pub struct RangeTo<Idx> { + /// The upper bound of the range (exclusive). + pub end: Idx, +} + /// The `Deref` trait is used to specify the functionality of dereferencing /// operations like `*v`. |
