about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-06 16:58:27 +0000
committerbors <bors@rust-lang.org>2018-08-06 16:58:27 +0000
commitb2397437530eecef72a1524a7e0a4b42034fa360 (patch)
tree429466887a0f431e3586e4985775d268dd2374f1 /src/libcore
parent4b8089daf8046d7999310d44e5c68ccff4ab255a (diff)
parent4687476470d383fefe62ac9cde4e6f9015ba550f (diff)
Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
Add errors for unknown, stable and duplicate feature attributes

- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.

```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`

#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0

#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```

Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).

There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/char/methods.rs20
-rw-r--r--src/libcore/lib.rs4
-rw-r--r--src/libcore/num/mod.rs20
-rw-r--r--src/libcore/slice/mod.rs10
-rw-r--r--src/libcore/tests/lib.rs5
5 files changed, 5 insertions, 54 deletions
diff --git a/src/libcore/char/methods.rs b/src/libcore/char/methods.rs
index 33fd6947c1e..64a17786b0a 100644
--- a/src/libcore/char/methods.rs
+++ b/src/libcore/char/methods.rs
@@ -1050,8 +1050,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1084,8 +1082,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1118,8 +1114,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1155,8 +1149,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1189,8 +1181,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1226,8 +1216,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1264,8 +1252,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1298,8 +1284,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1349,8 +1333,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1385,8 +1367,6 @@ impl char {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index 72074e1dbce..a4a01990c22 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -82,7 +82,6 @@
 #![feature(concat_idents)]
 #![feature(const_fn)]
 #![feature(const_int_ops)]
-#![feature(core_float)]
 #![feature(custom_attribute)]
 #![feature(doc_cfg)]
 #![feature(doc_spotlight)]
@@ -102,8 +101,6 @@
 #![feature(rustc_attrs)]
 #![feature(rustc_const_unstable)]
 #![feature(simd_ffi)]
-#![feature(core_slice_ext)]
-#![feature(core_str_ext)]
 #![feature(specialization)]
 #![feature(staged_api)]
 #![feature(stmt_expr_attributes)]
@@ -111,7 +108,6 @@
 #![feature(untagged_unions)]
 #![feature(unwind_attributes)]
 #![feature(doc_alias)]
-#![feature(inclusive_range_methods)]
 #![feature(mmx_target_feature)]
 #![feature(tbm_target_feature)]
 #![feature(sse4a_target_feature)]
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 6e2fbf6f84f..44a3b310ebe 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -3761,8 +3761,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3799,8 +3797,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3837,8 +3833,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3878,8 +3872,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3916,8 +3908,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3957,8 +3947,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3999,8 +3987,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -4037,8 +4023,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -4092,8 +4076,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -4132,8 +4114,6 @@ impl u8 {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs
index dfebe460ff8..187ac3c7a7f 100644
--- a/src/libcore/slice/mod.rs
+++ b/src/libcore/slice/mod.rs
@@ -2007,7 +2007,7 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
     fn index_mut(self, slice: &mut T) -> &mut Self::Output;
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for usize {
     type Output = T;
 
@@ -2056,7 +2056,7 @@ impl<T> SliceIndex<[T]> for usize {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for  ops::Range<usize> {
     type Output = [T];
 
@@ -2117,7 +2117,7 @@ impl<T> SliceIndex<[T]> for  ops::Range<usize> {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
     type Output = [T];
 
@@ -2152,7 +2152,7 @@ impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
     type Output = [T];
 
@@ -2187,7 +2187,7 @@ impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for ops::RangeFull {
     type Output = [T];
 
diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs
index 2323b30a010..fc92a5a2225 100644
--- a/src/libcore/tests/lib.rs
+++ b/src/libcore/tests/lib.rs
@@ -8,18 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(ascii_ctype)]
 #![feature(box_syntax)]
 #![feature(cell_update)]
-#![feature(core_float)]
 #![feature(core_private_bignum)]
 #![feature(core_private_diy_float)]
 #![feature(dec2flt)]
-#![feature(decode_utf8)]
 #![feature(euclidean_division)]
 #![feature(exact_size_is_empty)]
 #![feature(fixed_size_array)]
-#![feature(float_internals)]
 #![feature(flt2dec)]
 #![feature(fmt_internals)]
 #![feature(hashmap_internals)]
@@ -29,7 +25,6 @@
 #![feature(refcell_map_split)]
 #![feature(refcell_replace_swap)]
 #![feature(slice_patterns)]
-#![feature(slice_rotate)]
 #![feature(sort_internals)]
 #![feature(specialization)]
 #![feature(step_trait)]