Skip to content

Commit 53c5fcb

Browse files
committed
Add lang items for ranges.
1 parent 21ea66f commit 53c5fcb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/libcore/ops.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,9 +882,11 @@ macro_rules! countable_impl(
882882
countable_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
883883

884884
/// An unbounded range.
885+
#[lang="full_range"]
885886
pub struct FullRange;
886887

887888
/// A range which i bounded at both ends.
889+
#[lang="range"]
888890
pub struct Range<Idx> {
889891
/// The lower bound of the range (inclusive).
890892
pub start: Idx,
@@ -926,6 +928,7 @@ impl<Idx: Clone + Countable> DoubleEndedIterator<Idx> for Range<Idx> {
926928
}
927929

928930
/// A range which is only bounded below.
931+
#[lang="range_from"]
929932
pub struct RangeFrom<Idx> {
930933
/// The lower bound of the range (inclusive).
931934
pub start: Idx,

src/librustc/middle/lang_items.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ lets_do_this! {
267267
IndexMutTraitLangItem, "index_mut", index_mut_trait;
268268
SliceTraitLangItem, "slice", slice_trait;
269269
SliceMutTraitLangItem, "slice_mut", slice_mut_trait;
270+
RangeStructLangItem, "range", range_struct;
271+
RangeFromStructLangItem, "range_from", range_from_struct;
272+
FullRangeStructLangItem, "full_range", full_range_struct;
270273

271274
UnsafeTypeLangItem, "unsafe", unsafe_type;
272275

0 commit comments

Comments
 (0)