Skip to content

Commit

Permalink
impl Pod for Range
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Aparicio committed Mar 8, 2015
1 parent efb4cc4 commit f8d30f9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ impl fmt::Debug for RangeFull {
}
}

#[cfg(stage0)]
/// A (half-open) range which is bounded at both ends.
#[derive(Clone, PartialEq, Eq)]
#[lang="range"]
Expand All @@ -988,6 +989,18 @@ pub struct Range<Idx> {
pub end: Idx,
}

#[cfg(not(stage0))]
/// A (half-open) range which is bounded at both ends.
#[derive(Clone, Eq, PartialEq, Pod)]
#[lang="range"]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Range<Idx> {
/// The lower bound of the range (inclusive).
pub start: Idx,
/// The upper bound of the range (exclusive).
pub end: Idx,
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
Expand Down

0 comments on commit f8d30f9

Please sign in to comment.