diff options
| author | bors <bors@rust-lang.org> | 2015-01-28 03:59:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-28 03:59:14 +0000 |
| commit | a530cc9706324ad44dba464d541a807eb5afdb08 (patch) | |
| tree | a8f9e5444cf2378b9c3d5a193484a3f6c9873a06 /src/libcore/array.rs | |
| parent | 92ff8ea52816982ad4cbfac8168e216d32d74c77 (diff) | |
| parent | 71223050538939ed758fcd3b9114f71abff20bb2 (diff) | |
| download | rust-a530cc9706324ad44dba464d541a807eb5afdb08.tar.gz rust-a530cc9706324ad44dba464d541a807eb5afdb08.zip | |
Auto merge of #21248 - brson:feature-staging, r=alexcrichton
This implements the remaining bits of 'feature staging', as described in [RFC 507](https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md).
This is not quite done, but the substance of the work is complete so submitting for early review.
Key changes:
* `unstable`, `stable` and `deprecated` attributes all require 'feature' and 'since', and support an optional 'reason'.
* The `unstable` lint is removed.
* A new 'stability checking' pass warns when a used unstable library feature has not been activated with the `feature` attribute. At 1.0 beta this will become an error.
* A new 'unused feature checking' pass emits a lint ('unused_feature', renamed from 'unknown_feature') for any features that were activated but not used.
* A new tidy script `featureck.py` performs some global sanity checking, particularly that 'since' numbers agree, and also prints out a summary of features.
Differences from RFC:
* As implemented `unstable` requires a `since` attribute. I do not know if this is useful. I included it in the original sed script and just left it.
* RFC didn't specify the name of the optional 'reason' attribute.
* This continues to use 'unstable', 'stable' and 'deprecated' names (the 'nice' names) instead of 'staged_unstable', but only activates them with the crate-level 'staged_api' attribute.
I intend to update the RFC based on the outcome of this PR.
Issues:
* The unused feature check doesn't account for language features - i.e. you can activate a language feature, not use it, and not get the error.
Open questions:
* All unstable and deprecated features are named 'unnamed_feature', which i picked just because it is uniquely greppable. This is the 'catch-all' feature. What should it be?
* All stable features are named 'grandfathered'. What should this be?
TODO:
* Add check that all `deprecated` attributes are paired with a `stable` attribute in order to preserve the knowledge about when a feature became stable.
* Update rustdoc in various ways.
* Remove obsolete stability discussion from reference.
* Add features for 'path', 'io', 'os', 'hash' and 'rand'.
cc #20445 @alexcrichton @aturon
Diffstat (limited to 'src/libcore/array.rs')
| -rw-r--r-- | src/libcore/array.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libcore/array.rs b/src/libcore/array.rs index a83537e12f7..44541c34ee2 100644 --- a/src/libcore/array.rs +++ b/src/libcore/array.rs @@ -12,7 +12,7 @@ //! up to a certain length. Eventually we should able to generalize //! to all lengths. -#![unstable] // not yet reviewed +#![unstable(feature = "core")] // not yet reviewed use clone::Clone; use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; @@ -26,7 +26,7 @@ use option::Option; macro_rules! array_impls { ($($N:expr)+) => { $( - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<T:Copy> Clone for [T; $N] { fn clone(&self) -> [T; $N] { *self @@ -39,14 +39,14 @@ macro_rules! array_impls { } } - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<T: fmt::Debug> fmt::Debug for [T; $N] { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(&&self[], f) } } - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<A, B> PartialEq<[B; $N]> for [A; $N] where A: PartialEq<B> { #[inline] fn eq(&self, other: &[B; $N]) -> bool { @@ -58,7 +58,7 @@ macro_rules! array_impls { } } - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; $N] where A: PartialEq<B>, Rhs: Deref<Target=[B]>, @@ -73,7 +73,7 @@ macro_rules! array_impls { } } - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<'a, A, B, Lhs> PartialEq<[B; $N]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]> @@ -88,10 +88,10 @@ macro_rules! array_impls { } } - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<T:Eq> Eq for [T; $N] { } - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<T:PartialOrd> PartialOrd for [T; $N] { #[inline] fn partial_cmp(&self, other: &[T; $N]) -> Option<Ordering> { @@ -115,7 +115,7 @@ macro_rules! array_impls { } } - #[stable] + #[stable(feature = "rust1", since = "1.0.0")] impl<T:Ord> Ord for [T; $N] { #[inline] fn cmp(&self, other: &[T; $N]) -> Ordering { |
