From 939cfa251aeb34b4b1a11396af1a3396792c708d Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 15 Mar 2018 02:50:55 +0800 Subject: [PATCH] Keep the fields of RangeInclusive unstable. --- src/liballoc/lib.rs | 1 + src/liballoc/tests/lib.rs | 1 + src/libcore/ops/range.rs | 6 ++++-- src/libcore/tests/lib.rs | 1 + src/librustc/lib.rs | 1 + src/librustc_mir/lib.rs | 1 + src/librustc_trans/lib.rs | 1 + 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index cbfec554604..fb7f114ba1a 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -123,6 +123,7 @@ #![feature(on_unimplemented)] #![feature(exact_chunks)] #![feature(pointer_methods)] +#![feature(inclusive_range_fields)] #![cfg_attr(not(test), feature(fn_traits, placement_new_protocol, swap_with_slice, i128))] #![cfg_attr(test, feature(test, box_heap))] diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index f5deecd47e8..4fea2375558 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -29,6 +29,7 @@ #![feature(unboxed_closures)] #![feature(unicode)] #![feature(exact_chunks)] +#![feature(inclusive_range_fields)] extern crate alloc_system; extern crate std_unicode; diff --git a/src/libcore/ops/range.rs b/src/libcore/ops/range.rs index 32aa6508805..be51f5239b0 100644 --- a/src/libcore/ops/range.rs +++ b/src/libcore/ops/range.rs @@ -283,6 +283,8 @@ impl> RangeTo { /// # Examples /// /// ``` +/// #![feature(inclusive_range_fields)] +/// /// assert_eq!((3..=5), std::ops::RangeInclusive { start: 3, end: 5 }); /// assert_eq!(3 + 4 + 5, (3..=5).sum()); /// @@ -294,10 +296,10 @@ impl> RangeTo { #[stable(feature = "inclusive_range", since = "1.26.0")] pub struct RangeInclusive { /// The lower bound of the range (inclusive). - #[stable(feature = "inclusive_range", since = "1.26.0")] + #[unstable(feature = "inclusive_range_fields", issue = "49022")] pub start: Idx, /// The upper bound of the range (inclusive). - #[stable(feature = "inclusive_range", since = "1.26.0")] + #[unstable(feature = "inclusive_range_fields", issue = "49022")] pub end: Idx, } diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index 85787f38f06..e53964b5769 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -47,6 +47,7 @@ #![feature(exact_chunks)] #![feature(atomic_nand)] #![feature(reverse_bits)] +#![feature(inclusive_range_fields)] extern crate core; extern crate test; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index ff2e8ea79d3..77259f156e5 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -75,6 +75,7 @@ #![feature(trusted_len)] #![feature(catch_expr)] #![feature(test)] +#![feature(inclusive_range_fields)] #![recursion_limit="512"] diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index ad7a5c94022..ff35412ea5b 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -39,6 +39,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![feature(nonzero)] #![feature(underscore_lifetimes)] #![cfg_attr(stage0, feature(never_type))] +#![feature(inclusive_range_fields)] extern crate arena; #[macro_use] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index f2b76eb57d6..9b09dbf5276 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -33,6 +33,7 @@ #![feature(slice_patterns)] #![feature(conservative_impl_trait)] #![feature(optin_builtin_traits)] +#![feature(inclusive_range_fields)] use rustc::dep_graph::WorkProduct; use syntax_pos::symbol::Symbol;