From bd3197c748e7bfa652fb636fbb78fa7a42d826ca Mon Sep 17 00:00:00 2001 From: Alex Burka Date: Wed, 13 Jan 2016 01:27:07 -0500 Subject: remove range lang items 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 #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 #30881). --- src/libcore/ops.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index cf8f4279a1d..b5bec316947 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -1468,7 +1468,7 @@ pub trait IndexMut: Index { /// An unbounded range. #[derive(Copy, Clone, PartialEq, Eq)] -#[lang = "range_full"] +#[cfg_attr(stage0, lang = "range_full")] // TODO remove attribute after next snapshot #[stable(feature = "rust1", since = "1.0.0")] pub struct RangeFull; @@ -1481,7 +1481,7 @@ impl fmt::Debug for RangeFull { /// A (half-open) range which is bounded at both ends. #[derive(Clone, PartialEq, Eq)] -#[lang = "range"] +#[cfg_attr(stage0, lang = "range")] // TODO remove attribute after next snapshot #[stable(feature = "rust1", since = "1.0.0")] pub struct Range { /// The lower bound of the range (inclusive). @@ -1501,7 +1501,7 @@ impl fmt::Debug for Range { /// A range which is only bounded below. #[derive(Clone, PartialEq, Eq)] -#[lang = "range_from"] +#[cfg_attr(stage0, lang = "range_from")] // TODO remove attribute after next snapshot #[stable(feature = "rust1", since = "1.0.0")] pub struct RangeFrom { /// The lower bound of the range (inclusive). @@ -1518,7 +1518,7 @@ impl fmt::Debug for RangeFrom { /// A range which is only bounded above. #[derive(Copy, Clone, PartialEq, Eq)] -#[lang = "range_to"] +#[cfg_attr(stage0, lang = "range_to")] // TODO remove attribute after next snapshot #[stable(feature = "rust1", since = "1.0.0")] pub struct RangeTo { /// The upper bound of the range (exclusive). -- cgit 1.4.1-3-g733a5